Edexcel International Advanced Level Computer Science, point 3.2.1
Definition
Encryption is the process of scrambling data so that it can't be understood by anyone who doesn't have the secret needed to unscramble it. Decryption is the reverse: turning the scrambled data back into the original.
Key terms
| Term | Meaning |
|---|---|
| Plaintext | The original, readable data (it isn't only text: it can be any data) |
| Ciphertext | The scrambled data produced by encryption |
| Encryption algorithm (cipher) | The set of steps (the method) used to scramble the data |
| Key | A value (a secret number or pattern) used by the algorithm, which decides exactly how the data is scrambled. The same algorithm with a different key gives a different result |
| Encrypt | Plaintext + key, through the algorithm, gives ciphertext |
| Decrypt | Ciphertext + key, through the algorithm, gives plaintext |
| Cryptanalysis | Trying to break a cipher without the key |
A good cipher's security should rely on the key being secret, not on the algorithm being secret. The algorithm can be public and tested by experts, as with AES.
Function
Encryption protects data from being read by anyone who shouldn't see it. It provides confidentiality. Together with other techniques it can also support:
- Integrity: detecting that data has been altered.
- Authentication: proving who sent a message (for example with digital signatures, 3.2.2).
Why needed
Data is often stored (on a laptop, in a database, in the cloud) and transmitted (over Wi-Fi and the Internet), where it can be stolen or intercepted. Encryption makes stolen data useless to the thief.
Examples:
- Online shopping and banking: card details and passwords are encrypted (HTTPS).
- Messaging apps: end-to-end encryption.
- Wi-Fi: WPA encryption stops eavesdropping.
- Stored data: encrypted laptops, phones and databases, protected if lost or hacked.
- Legal requirements: data protection laws expect appropriate security for personal data.
Characteristics
- A strong cipher is very hard to break without the key, even if the algorithm is known.
- Strength depends on the key length: more bits means more possible keys (a larger key space), so brute force (trying every key) takes longer. A key of bits has possible values, so each extra bit doubles the work.
| Key length | Number of keys |
|---|---|
| 8 bits | 256 |
| 56 bits | about |
| 128 bits | about |
| 256 bits | about |
- Weak ciphers can be broken by analysing patterns (such as how often letters appear, 3.2.3).
Benefits
The book names three:
- Privacy: only the intended reader can read the data.
- Security: stolen or intercepted data is useless without the key.
- Integrity: tampered ciphertext won't decrypt to sensible data, so changes can be noticed.
Also:
- Confidentiality of data in storage and transit.
- Builds trust in online services.
- Helps with legal compliance.
- Can detect tampering and verify identity when combined with other methods.
Drawbacks
- Processing time and power: encrypting and decrypting needs computation, which can slow systems down and use more battery.
- Key management: keys must be generated, shared securely, stored safely and changed. If the key is lost, the data is lost for good.
- It doesn't prevent data being deleted, blocked or copied in encrypted form, or stolen by someone who has the key (for example through phishing or malware).
- Weak keys or old algorithms give a false sense of security.
- Law enforcement may be unable to read encrypted data, which raises ethical and legal debates.
Worked example
Task: a charity stores donors' details on a laptop. Explain how encryption helps if the laptop is stolen, and what could still go wrong.
- How it helps: the files (or whole disk) are encrypted with a key derived from a password. A thief who takes the laptop sees only ciphertext, and can't read the donors' details without the key. The charity avoids a serious data breach.
- What could still go wrong:
- A weak password makes the key easy to guess (brute force).
- If the laptop was already unlocked and logged in when stolen, the data may be accessible.
- If the password is lost, even the charity can't get the data back, so a backup and key recovery plan are needed.
- Encryption slows older laptops slightly.
Exam tip: use the correct terms: plaintext, ciphertext, key and algorithm. You may be asked to complete a diagram of the encryption and decryption process, so be clear that the key goes into both steps. Encryption doesn't stop data being stolen: it stops it being understood.
Check yourself
What is the difference between plaintext and ciphertext?
Plaintext is the original readable data. Ciphertext is the scrambled data produced by encrypting it.
What is the role of the key in encryption?
It is the secret value used by the algorithm that determines how the data is scrambled, so only someone with the right key can decrypt it.
Why does a longer key make encryption stronger?
There are more possible keys (2ⁿ), so a brute-force attack must try many more, and each extra bit doubles the work.
Give two drawbacks of encryption
Any two of: it needs processing time and power; keys must be managed securely; lost keys mean lost data; it doesn't stop data being deleted or taken by someone with the key.
Why shouldn't security depend on keeping the algorithm secret?
A secret algorithm hasn't been tested by experts and can be discovered, whereas a well-tested public algorithm with a secret key can be trusted.