What is Encryption?
Encryption is the process of converting data (plaintext) into an unreadable form (ciphertext) using an algorithm and a key. Only someone with the correct key can decrypt it back to plaintext.
- Plaintext: original readable data
- Ciphertext: scrambled, unreadable data
- Key: a value used to encrypt and decrypt data
- Encryption algorithm: the mathematical process applied
Encryption protects data in transit (e.g. online banking) and at rest (e.g. encrypted files).
Symmetric Encryption
In symmetric encryption, the same key is used to both encrypt and decrypt the data.
- Fast and efficient
- Problem: securely sharing the key with the recipient — if the key is intercepted, the data is compromised
- Example: AES (Advanced Encryption Standard)
Asymmetric Encryption
In asymmetric encryption, two mathematically linked keys are used:
- Public key: shared openly with anyone. Used to encrypt data.
- Private key: kept secret by the owner. Used to decrypt data.
Only the private key holder can decrypt data encrypted with their public key. This solves the key-sharing problem.
How it works:
- Alice wants to send Bob a secure message
- Bob shares his public key with Alice
- Alice encrypts the message using Bob's public key
- Bob decrypts using his private key (only he has it)
| Feature | Symmetric | Asymmetric |
| Keys used | One shared key | Public + Private key pair |
| Speed | Faster | Slower |
| Key sharing | Problem — key must be shared securely | Safe — public key shared openly |
| Example | AES | RSA, SSL/TLS handshake |
SSL/TLS
SSL (Secure Sockets Layer) and its successor TLS (Transport Layer Security) are protocols that provide secure, encrypted connections over the internet.
- Used by HTTPS websites (the padlock in the browser)
- SSL/TLS uses asymmetric encryption to exchange a session key
- Then uses symmetric encryption (with that session key) for speed during the session
- Provides: confidentiality, integrity, and authentication
Exam tip: A common question asks you to describe the difference between symmetric and asymmetric encryption. The key distinction: symmetric uses ONE shared key (fast but key sharing is risky); asymmetric uses a KEY PAIR (public to encrypt, private to decrypt — more secure for key exchange). SSL/TLS combines both.
⚠️ Common Mistakes
- Saying the public key decrypts — the public key ENCRYPTS; only the private key decrypts
- Confusing SSL and TLS — TLS is the modern, more secure successor to SSL; both are commonly called "SSL" informally
- Thinking encryption prevents interception — it doesn't stop data being captured, it just makes it unreadable to the interceptor