CIE AS & A Level Computer Science, section 17.1 (Encryption, encryption protocols and digital certificates)
The problem
If you receive a public key, how do you know it really belongs to the website or person? An attacker could pretend to be them.
Digital certificate
A digital certificate is an electronic document that links a public key to its owner. It contains:
- the owner's name (and the website address)
- the owner's public key
- the certificate authority (CA) that issued it
- its serial number and dates when it is valid
- the CA's digital signature
Certificate authority
A certificate authority is a trusted organisation that checks the identity of the applicant, then issues a certificate signed with the CA's own private key. Browsers hold a list of trusted CAs and check that a certificate is signed by one of them, and is in date.
Digital signature
A digital signature shows who sent a message (authentication) and that it has not been changed (integrity).
Creating it:
- The sender produces a hash (a short, fixed-size summary) of the message, using a hashing algorithm.
- The hash is encrypted with the sender's private key. This is the signature, which is sent with the message.
Checking it:
- The receiver decrypts the signature with the sender's public key, giving the hash.
- The receiver hashes the message they received.
- If the two hashes are the same, the message is genuine and unchanged.
Summary
| Item | Gives |
|---|---|
| Encryption | confidentiality |
| Digital signature | authentication and integrity |
| Digital certificate | trust that a public key belongs to its owner |
Common mistake: saying the signature encrypts the whole message with the private key. Only the hash is encrypted. Also, a certificate does not encrypt anything: it proves who owns a public key.
Exam tip: for a digital signature, give both steps (hash then encrypt with the private key) and say what the receiver compares. State what it proves: sender and unchanged message.
Check yourself
Identify two items found in a digital certificate.
Any two of: the owner’s name, public key, issuing authority, validity dates, serial number and the authority’s signature.
Which key is used to create a digital signature?
The sender’s private key, applied to the hash of the message.
What does it show if the two hashes match when a signature is checked?
The message came from the claimed sender and has not been changed.