Topic 2 · Data transmission
Encryption
Why data is encrypted, and how symmetric and asymmetric encryption use keys to keep it secret.
Why encrypt?
Data sent across a network can be intercepted. Encryption does not stop someone from intercepting data, but it makes the data meaningless to anyone without the key.
The readable data is plaintext. An encryption algorithm and a key turn it into scrambled ciphertext. Only someone with the right key can turn it back.
- 1Plaintext
MEET AT 3 - 2Encrypt with a keyAlgorithm + key
- 3Ciphertext
X9#q!2Lm@, safe to send - 4Decrypt with a keyBack to
MEET AT 3
Symmetric encryption
Symmetric encryption uses the same key to encrypt and decrypt. It is fast, but the key itself has to be shared with the receiver. If the key is intercepted while it is being shared, every message can be read.
Asymmetric encryption
Asymmetric encryption uses a matching pair of keys. The public key can be given to anyone and is used to encrypt. The private key is kept secret by its owner and is the only key that can decrypt.
So if Ben wants to send Asha a message, he encrypts it with Asha's public key. Only Asha's private key can decrypt it, and that key never leaves her computer.
| Symmetric | Asymmetric | |
|---|---|---|
| Keys | One shared secret key | Public key and private key |
| Encrypt with | The secret key | The receiver's public key |
| Decrypt with | The same secret key | The receiver's private key |
| Main problem | Sharing the key safely | Slower to encrypt and decrypt |
Key idea. Public key encrypts, private key decrypts. The private key is never sent anywhere.
Key terms
- Plaintext
- Data before it is encrypted.
- Ciphertext
- Data after it has been encrypted.
- Symmetric encryption
- The same key is used to encrypt and decrypt.
- Asymmetric encryption
- A public key encrypts and a matching private key decrypts.
Check yourself
Does encryption stop data from being intercepted?Show answer
No. It makes intercepted data unreadable without the key.
What is the main weakness of symmetric encryption?Show answer
The same key must be shared with the receiver, and it could be intercepted while being shared.
Asha wants to receive a secret message. Which key does she share?Show answer
Her public key. She keeps her private key secret and uses it to decrypt.