Advanced System Software and Security: Question 5
Syllabus 17.1
GreenLeaf Books is an online bookshop. A customer buys a book from its website, which uses SSL/TLS to secure the connection.
(a) The customer's browser needs to send their credit card details to GreenLeaf Books so that only GreenLeaf Books can read them. State which key should be used to encrypt the credit card details, and explain why using this key means only GreenLeaf Books can decrypt the resulting cipher text. [2]
(b) GreenLeaf Books wants its order-confirmation email to carry a digital signature, so the customer can be confident it genuinely came from GreenLeaf Books and was not altered after it was sent. Describe how GreenLeaf Books creates this digital signature, and how the customer's computer verifies it. [4]
(c) GreenLeaf Books' server presents a digital certificate, issued by a Certificate Authority (CA), when the SSL/TLS connection with the customer's browser is set up. State the purpose this digital certificate serves in the connection, and describe the process by which GreenLeaf Books obtained it from the CA. [3]
Show worked solution Hide worked solution
Worked solution
Part (a): Encrypting a private message to an organisation
Asymmetric (public-key) cryptography uses a mathematically linked pair of keys for each party: a public key, which can be freely given to anyone, and a private key, which is kept secret and known only to its owner. Data encrypted with one key of the pair can only be decrypted with the other matching key from the same pair.
To send a message that only GreenLeaf Books can read, the customer’s browser must encrypt the credit card details using GreenLeaf Books’ public key. Because only GreenLeaf Books holds the matching private key, only GreenLeaf Books can decrypt the resulting cipher text back into plain text. Even though the public key used to encrypt it is not secret at all, and anyone (even someone intercepting the message) could have used it to encrypt something, only the organisation holding the private key can undo that encryption. [2 marks]: [1] for identifying GreenLeaf Books’ public key as the correct key to encrypt with, [1] for explaining that only the matching private key (held solely by GreenLeaf Books) can decrypt it.
Part (b): Creating and verifying a digital signature
A digital signature does not simply mean encrypting the whole message with a private key. It is built from a hash (message digest) of the message:
- GreenLeaf Books runs the order-confirmation message through a hash function, producing a fixed-length message digest.
- GreenLeaf Books encrypts this digest (not the whole message) using its own private key. This encrypted digest is the digital signature, which is attached to the original message (sent as plain text) before it is sent to the customer.
When the customer’s computer receives the message and its attached signature, it verifies the signature as follows:
- It decrypts the signature using GreenLeaf Books’ public key, recovering the original message digest that GreenLeaf Books created.
- It independently runs the same hash function on the message it actually received, producing its own digest.
- It compares the two digests. If they match, the customer can be confident the message really did come from GreenLeaf Books, because only GreenLeaf Books’ private key could have produced a signature that decrypts correctly with GreenLeaf Books’ public key, and that the message has not been altered in transit, because even a single changed character in the message would produce a completely different recomputed digest.
[4 marks]: [1] for hashing the message to create a digest, [1] for encrypting the digest with the sender’s (GreenLeaf Books’) private key to form the signature, [1] for decrypting the received signature with the sender’s public key to recover the original digest, [1] for recomputing the digest of the received message and comparing the two digests to confirm authenticity and integrity.
Part (c): The role and acquisition of a digital certificate
Purpose: the digital certificate confirms that the public key being used to set up this SSL/TLS session genuinely belongs to GreenLeaf Books, and not to an impostor pretending to be GreenLeaf Books. This lets the customer’s browser trust the identity of the website it is connecting to, and trust that the public key it will use during the SSL/TLS handshake to protect this session (for example, when later sending the credit card details from part (a)) really does belong to GreenLeaf Books, before any confidential data is exchanged.
Obtaining the certificate: GreenLeaf Books first generates its own public/private key pair. It then sends a request to a trusted Certificate Authority (CA), containing its public key together with information proving its identity (such as company and domain details). The CA carries out its own checks to verify that this information is genuine, and, once satisfied, digitally signs a certificate containing GreenLeaf Books’ public key and identity details, using the CA’s own private key. This signed certificate is issued to GreenLeaf Books, which installs it on its web server so it can be presented to browsers during the SSL/TLS handshake; a browser can then check the CA’s signature on the certificate using the CA’s public key (already trusted by the browser or operating system) to confirm the certificate itself is genuine.
[3 marks]: [1] for stating the certificate’s purpose (binding/verifying that the public key belongs to GreenLeaf Books, enabling trust before data is exchanged), [1] for GreenLeaf Books requesting the certificate from the CA with its public key and identity information, [1] for the CA verifying this and signing the certificate with the CA’s own private key before issuing it.
Final answers
- (a) Encrypt with GreenLeaf Books’ public key; only its matching private key can decrypt it.
- (b) Sign by hashing the message and encrypting the digest with the sender’s private key; verify by decrypting with the sender’s public key and comparing digests.
- (c) The certificate binds GreenLeaf Books’ public key to its verified identity; it is obtained by submitting the public key and identity proof to a CA, which verifies it and signs the certificate with the CA’s own private key.