CIE AS & A Level Computer Science, section 17.1 (Encryption, encryption protocols and digital certificates)
Purpose of encryption
Encryption scrambles data so that it cannot be understood by anyone who intercepts it. The original data is the plaintext; the scrambled version is the ciphertext. A key is used to encrypt and decrypt. Encryption protects confidentiality, but it does not stop data being intercepted or deleted.
Symmetric encryption
The same key is used to encrypt and decrypt.
- Fast, so it suits large amounts of data.
- The problem is key exchange: the key must be sent to the other person securely, and if it is intercepted, the data can be read.
A Caesar cipher is very weak. Modern ciphers such as AES use long keys and complex operations.
Asymmetric encryption
Each user has two linked keys:
- a public key, which anyone can know
- a private key, kept secret by its owner
Data encrypted with the public key can only be decrypted with the matching private key. To send Aisha a secret message, you encrypt it with Aisha's public key. Only Aisha can decrypt it. There is no need to share a secret key.
- Benefit: solves the key exchange problem.
- Drawback: much slower than symmetric encryption.
Key length
A longer key means more possible keys, so a brute-force attack takes much longer. A key of bits has possible values.
Comparing
| Symmetric | Asymmetric | |
|---|---|---|
| Keys | one shared key | public and private pair |
| Speed | fast | slow |
| Key exchange | a problem | not a problem |
Common mistake: thinking the private key is used to encrypt a message for someone else. To send a secret message to someone, use their public key; only their private key can decrypt it. Also, encryption does not make data safe from being deleted.
Exam tip: say which key encrypts and which key decrypts. In a comparison, mention key exchange and speed.
Check yourself
What is the difference between plaintext and ciphertext?
Plaintext is the original readable data; ciphertext is the encrypted, scrambled version.
Which key do you use to encrypt a message to send to Ben using asymmetric encryption?
Ben’s public key.
Why is symmetric encryption faster than asymmetric?
It uses simpler operations with a single key, whereas asymmetric encryption involves more complex calculations.