CIE AS & A Level Computer Science, section 17.1 (Encryption, encryption protocols and digital certificates)
Purpose
SSL (Secure Socket Layer) and its replacement TLS (Transport Layer Security) are protocols that make a connection between two computers secure, so the data cannot be read or changed on the way. They give encryption, and authentication of the server.
Where they are used
- HTTPS web pages (online banking, shopping, logins)
- Secure email transfer
- Secure file transfer, and voice over IP
How a secure connection starts (the handshake)
Asymmetric encryption is slow, and symmetric encryption has the key exchange problem. TLS uses both.
- The client asks for a secure connection.
- The server sends its digital certificate, with its public key.
- The client checks that the certificate is valid and trusted.
- The client creates a session key (a symmetric key), encrypts it with the server's public key and sends it.
- The server decrypts it with its private key.
- Both now use the session key to encrypt the data quickly (symmetric encryption).
The session key is new for each session, so a stolen key only affects one session.
Why both types
| Step | Type | Reason |
|---|---|---|
| Sharing the session key | asymmetric | no secret has to be sent in advance |
| Sending the data | symmetric | faster |
Recognising it
A browser shows a padlock and https:// when a TLS connection is in place.
Common mistake: saying the page data is encrypted with the public key in HTTPS. Only the session key is exchanged that way; the data is encrypted with the session key (symmetric). Also, SSL has been replaced by TLS, but the ideas are the same.
Exam tip: describe the handshake in order and say why both types of encryption are used: asymmetric to share the key and symmetric for speed.
Check yourself
What does a client send to the server to set up the session key?
The session key, encrypted with the server’s public key.
Why is the data encrypted with a session key rather than a public key?
Symmetric encryption is much faster, which suits large amounts of data.
Give two uses of TLS.
Any two of: HTTPS web pages, secure email transfer, secure file transfer, voice over IP.