Encryption and key ownership
Some messages must stay secret. Others are meant for everyone, but readers must be able to trust them. The Veyra notice service does both: it sends a confidential inspection report to Luma workshop, and publishes entrance notices anyone can read. Secrecy and proof of origin use keys in different directions.
What encryption does
An encryption algorithm uses a key to transform plaintext into ciphertext. Decryption uses the appropriate key and algorithm to recover the plaintext. The algorithm may be public; the necessary secret key must remain protected.
Compare who holds which key: one green key copied to both sides, or a violet private key and a blue-grey public key for each owner.
What each arrangement costs in practice:
| Method | Keys and ownership | Main consequence |
|---|---|---|
| Symmetric | Veyra and Luma share one secret key; the same key encrypts and decrypts. | Fast for large messages, but both sides need a secure way to obtain the secret. |
| Asymmetric | An owner holds a mathematically linked public/private pair. The public key is distributed; the private key stays with its owner. | A public key can be shared openly. The private key never needs to travel. |
Whose key, and what it protects
Every key choice protects one of three things. Name the key’s owner and purpose: “use the public key” alone leaves both unclear.
| Protection | What it means |
|---|---|
| Confidentiality | Unauthorised readers cannot understand the content. |
| Authenticity | The claimed origin can be verified. |
| Integrity | An alteration can be detected. |
1 Veyra and Luma use one shared key. What problem must they solve before the first message?
2 How many keys does Luma own in asymmetric encryption, and which one may it give to anyone?
3 A notice must not be changed without anyone noticing. Which protection is this: confidentiality, authenticity or integrity?
- 1getting the shared key to the other side securely, without it being intercepted
- 2two, a matched pair: it gives out Luma public key and keeps Luma private key
- 3integrity
Sending a private message
Anything sent across a network can be copied on the way. Veyra’s inspection report must be useless to anyone who copies it: only Luma may read it. Veyra encrypts it using Luma’s public key; only the matching Luma private key can decrypt it.
Watch the two keys: the blue-grey one locks the report at Veyra, and only the violet one at Luma opens it again.
Why no secret key has to travel
Veyra does not have to send a shared secret across an unprotected channel. A certificate can establish whose public key it received; otherwise an impostor could substitute a different key.
Replying: use the other owner’s keys
For Luma’s confidential reply, Luma uses Veyra’s public key; Veyra decrypts with Veyra’s private key. Reusing Luma’s private key at Veyra would expose Luma’s secret.
1 Veyra sends Luma a private report. Which key encrypts it, and which key decrypts it?
2 Luma replies privately to Veyra. Which key encrypts the reply?
3 An attacker copies the ciphertext on the way. Why can they not read it?
- 1encrypt: Luma public key; decrypt: Luma private key
- 2Veyra public key; Veyra decrypts with Veyra private key
- 3only Luma private key can decrypt it, and that key never leaves Luma
Verifying the sender
Veyra’s entrance notices are for everyone, so there is nothing to keep secret. The danger is a fake: a notice that claims to be Veyra’s and sends visitors to the wrong door. Readers need to know that a notice came from Veyra.
Follow the notice from 1 to 3: Veyra uses its private key, every reader uses Veyra’s public key.
Signing this way gives verification, not confidentiality: everyone can obtain Veyra’s public key and read the notice.
Which key for secrecy, which for proof
Two jobs, opposite directions. Read across: whose key the sender uses, then whose key the receiver uses.
| Requirement | At sender | At receiver |
|---|---|---|
| Private report to Luma | Encrypt: Luma public key | Decrypt: Luma private key |
| Verified notice from Veyra | Apply: Veyra private key | Check: Veyra public key |
Only the owner should hold the private key. Verification supports non-repudiation: evidence makes it harder for that owner to deny sending the message. This depends on the private key staying secure and the public key being bound to the right identity.
Why sign a short digest
A long notice is expensive to process with public-key operations. A digital signature normally applies the private-key operation to a short message digest. The readable notice and its signature then travel together.
1 Which key does Veyra use so that readers can check a notice came from Veyra?
2 Which key do the readers use to check it?
3 Does this keep the notice secret? Why?
- 1Veyra private key
- 2Veyra public key
- 3no: anyone can obtain Veyra public key, so anyone can read the notice
Hashes and digital signatures
To show a notice is unchanged, Veyra needs a short fingerprint of it that changes if a single word does. A cryptographic hash function produces a fixed-length digest from a message. The same message and function reproduce the digest; a changed message is likely to produce a different one. Hashing is one-way, not reversible encryption.
Veyra hashes the notice, then signs the digest with Veyra’s private key. This protected digest is the digital signature. Readers follow two routes and compare their results:
A changed word changes the digest
| Notice | SHA-256 digest (first 20 of 64 hex digits) |
|---|---|
| The east entrance opens after inspection. | fb8cba18d41e282a56f9… |
| The east entrance opens before inspection. | 3571831a84adaafd1380… |
One word changed, and the whole digest changed. Keeping the old signature with the altered notice makes the digest comparison fail.
Why a hash alone does not prove the sender
An attacker could replace both a plain message and an unsigned digest. The private-key signature protects the origin of the digest. A valid comparison supports authenticity and integrity; the notice remains readable. Encrypt it separately if secrecy is also needed.
1 Put the reader’s steps in order: compare the digests; hash the received notice; recover the original digest with Veyra public key.
2 The notice is changed on the way but the old signature is kept. What does the reader find?
3 Why is a hash on its own not enough to prove who sent a message?
- 1hash the received notice; recover the original digest with Veyra public key; compare the two digests
- 2the new digest differs from the original digest, so the notice is rejected
- 3an attacker could replace both the message and an unsigned digest; only Veyra private key can make a signature that Veyra public key checks
Certificates and authorities
Readers check Veyra’s signature with Veyra’s public key. But how do they know that key belongs to Veyra, and not to an impostor? Someone they already trust vouches for it: a Certification Authority (CA) checks who Veyra is, then signs a digital certificate that binds that identity to the public key.
How Veyra gets a certificate
Follow Veyra’s public key from Veyra to the CA, into the signed certificate, and on to a reader. The numbers on the drawing match the steps.
What the CA signs: find each field on the certificate in the drawing.
| Certificate field | Purpose |
|---|---|
| Subject / holder | Identifies the person or organisation whose key is recorded. |
| Subject public key | Veyra’s key, not the CA’s private key. |
| Issuer, serial number and validity dates | Identify the certificate and when it is valid. |
| CA digital signature | Allows the signed certificate contents to be checked. |
How a reader checks a certificate
A reader checks the certificate’s signature using the CA’s public key, checks the holder identity and validity, and accepts the subject key only through a trusted issuer. PKI (Public Key Infrastructure) provides the authorities, certificates and trust arrangements supporting this process.
1 What does Veyra send to the CA, and what does it keep?
2 Which key does the CA use to sign the certificate, and which key does a reader use to check that signature?
3 Name two fields found in a digital certificate.
- 1it sends Veyra public key and its identity details; it keeps Veyra private key
- 2signs: CA private key; checks: CA public key
- 3any two: subject (holder) name, subject public key, issuer, serial number, validity dates, the CA’s digital signature
SSL and TLS
When Veyra’s staff log in, their passwords cross networks Veyra does not control. SSL (Secure Sockets Layer) and its successor TLS (Transport Layer Security) secure communication between a client and a server. HTTPS uses this protection for web traffic.
The handshake, step by step
Read the timeline from top to bottom: each arrow is one message between client and server, numbered as in the steps.
Which keys do which job
Public-key work is slow, so TLS uses it once to set up the session, then switches to something faster:
| During setup | During data transfer |
|---|---|
| Certificate/public-key operations authenticate the server and support key establishment. | Symmetric encryption efficiently protects repeated application messages. |
| A simplified key-transport model encrypts a session secret with the server public key; only its private key can recover it. | The agreed session keys protect traffic for this session; the server private key is not shared. |
The key-establishment details depend on the protocol version and chosen method. TLS is the improved successor to SSL; describing the historical key-transport model does not mean every TLS handshake sends an encrypted session key.
Where Veyra uses TLS
Veyra’s staff login sends a password and session cookie; its workshop portal carries private reports. TLS protects both exchanges and helps the client check that it reached the intended server. A signed public notice can still benefit from TLS during retrieval.
1 What does the server send so that the client can check who it is?
2 Which kind of key protects the data once the handshake is over, and why that kind?
3 Give one use of TLS on Veyra’s web service.
- 1its digital certificate, which holds the server public key
- 2symmetric session keys: symmetric encryption is faster for the many messages of a session
- 3the staff login (password and session cookie) or the report portal
Quantum cryptography
Every method so far relies on a key staying out of an eavesdropper’s hands. Quantum physics offers a way to notice when someone has looked. Quantum key distribution (QKD) uses properties of quantum particles, such as the polarisation of photons, to establish a shared secret key. The key then protects data using an encryption method.
How QKD shares a key and spots an eavesdropper
Each photon carries one bit of the key in its polarisation. Look for the amber one: the eavesdropper measured it, and it arrives changed. The numbers match the steps.
Weigh it up for Veyra: two gains, then two costs.
| Benefit or drawback | Why it matters |
|---|---|
| Benefit: eavesdropping detection | Disturbance can expose an attempt to discover the key, allowing it to be rejected. |
| Benefit: quantum states cannot be copied perfectly | An attacker cannot simply duplicate unknown states and keep an undisturbed copy for later measurement. |
| Drawback: specialist hardware and a dedicated channel | Installation is costly compared with an ordinary network connection. |
| Drawback: distance and transmission limits | Loss or changes in the travelling photons restrict reliable links; an arbitrary internet route cannot simply become a quantum channel. |
What QKD does not protect
Veyra would still need protected endpoints and suitable encryption for the notice data. QKD concerns key establishment; it does not make a stolen private report safe after a recipient opens it. For a widely accessed notice portal, the specialist link requirements are a major constraint.
1 What does quantum key distribution establish: the message, or the key?
2 Why can an eavesdropper be detected?
3 Give one drawback of quantum cryptography.
- 1a shared secret key, which then protects the data with an encryption method
- 2measuring a photon disturbs its state, so the endpoints find errors when they compare a sample
- 3any one: specialist hardware and a dedicated channel are costly; distance limits; an ordinary internet route cannot be used
Choosing the protection
Encryption, signatures, certificates and TLS each stop one attack and leave others open. So start with what an attacker must be prevented from doing. Choose the mechanism whose key route stops it, then ask what still needs protection.
Each row is one job Veyra needs done, from private reports to the staff login. Read across: the protection that does the job, then what it still leaves open.
| Veyra’s requirement | Protection and reason | Remaining limit |
|---|---|---|
| Send a report only Luma can read | Encrypt for Luma public key; decrypt with Luma private key. | Does not establish which sender used the public key. |
| Publish an authentic entrance notice | Hash it and sign the digest with Veyra private key; check with Veyra public key. | The notice is readable; identity depends on trusting the public key. |
| Bind Veyra’s name to that key | Use a CA-signed certificate and check the CA signature, identity and validity. | A certificate is not message encryption. |
| Protect a staff login and report portal | Use TLS: authenticate the server and protect the session using agreed keys. | Protection in transit does not secure a compromised endpoint. |
| Establish a key while detecting interception | Consider QKD on a suitable specialist link. | Cost and channel constraints remain. |
Secret and signed: both at once
A report can need both: only Luma may read it, and Luma must be able to prove it came from Veyra. Follow the report from Veyra to Luma: four keys, two owners, numbered as in the steps.
The outer encryption answers “who may read it?”. The signature answers “whose key signed it, and is it unchanged?”. Each private key stays with its owner throughout.
1 Veyra must send Luma a report that only Luma can read and that Luma can prove came from Veyra. Which key does Veyra use to sign, and which to encrypt?
2 Which two keys does Luma use, in order?
3 A staff login page must be protected while data travels. Which protection fits?
- 1sign with Veyra private key; encrypt with Luma public key
- 2Luma private key to decrypt, then Veyra public key to verify the signature
- 3TLS