Learn
2.3 | SYMMETRIC AND ASYMMETRIC ENCRYPTION
01 | WHY ENCRYPT DATA?
You send a private message over a network. Someone who intercepts the traffic should not be able to read its contents. Encryption transforms readable data into an encrypted form using an algorithm and a key.
Confidentiality means keeping information from unauthorised readers. Encryption is used to protect sensitive data during transmission, such as personal messages, account information or payment details.
Encryption does not stop someone intercepting or copying the encrypted data. Its purpose is to make the contents impractical to understand without the required key, when a suitable method is correctly used.
02 | PLAINTEXT, CIPHERTEXT AND KEYS
| Term | Meaning | Example role |
|---|---|---|
| Plaintext | The original unencrypted data | A message before encryption |
| Encryption algorithm | The method that transforms the data | A defined sequence of operations |
| Key | A value used by the algorithm | Determines the transformation |
| Ciphertext | The encrypted data | What is sent over the network |
| Decryption | Recovering the original data using the appropriate method and key | The receiver restores the message |
The algorithm and key have different roles. Knowing how the algorithm works should not, by itself, reveal the message without the necessary secret key. A key is not necessarily a human-readable password.
03 | SYMMETRIC: THE SAME SECRET KEY
Symmetric encryption uses the same secret key to encrypt and decrypt the data. The sender and receiver must both have that key.
- Alice and Bob obtain the same secret key through a secure arrangement.
- Alice encrypts her plaintext using that key.
- Alice sends the ciphertext to Bob.
- Bob decrypts it using the same key.
The ciphertext can cross an untrusted network. The key must remain secret. Sending the key openly beside the ciphertext would let an interceptor try to decrypt the message.
Symmetric encryption is generally efficient for large amounts of data. Its main practical difficulty is securely sharing and managing the secret key. If that key is exposed, messages protected with it can lose confidentiality.
04 | A SHIFT CIPHER: A SIMPLE SHARED-KEY MODEL
To see what a key does, move each letter three places forward in the alphabet. The key is the shift amount, 3.
| Operation | Input | Key | Output |
|---|---|---|---|
| Encrypt | CAFE | Shift forward 3 | FDIH |
| Decrypt | FDIH | Shift backward 3 | CAFE |
After Z, wrap around to A. Decryption reverses the transformation using the same shift amount.
This is not secure modern encryption. There are only 26 shifts to try, and letter patterns reveal information. The example teaches plaintext, ciphertext and keys, not a method for protecting real personal data.
05 | TRY IT: ENCRYPT AND DECRYPT
Only A–Z letters change; lowercase letters are first converted to uppercase. Spaces, digits and punctuation are retained. Encrypt a message, then paste the result back and decrypt with the same key.
06 | ASYMMETRIC: TWO RELATED KEYS
Asymmetric encryption uses a mathematically related pair of keys: a public key and a private key. They have different roles.
| Key | Who may have it? | Role when sending a confidential message to Bob |
|---|---|---|
| Bob’s public key | Can be shared openly | Alice uses it to encrypt for Bob |
| Bob’s private key | Bob keeps it secret | Bob uses it to decrypt |
Bob can publish his public key without publishing his private key. With a suitable algorithm and key size, deriving the private key from the public key should be computationally impractical.
The two keys are not identical. Someone who only has Bob’s public key should not be able to decrypt ciphertext encrypted for Bob.
07 | SEND TO THE RIGHT PERSON
- Bob generates a public/private key pair and keeps his private key secret.
- Alice obtains and verifies Bob’s public key.
- Alice encrypts the message using Bob’s public key.
- Alice sends the ciphertext to Bob.
- Bob decrypts it using Bob’s private key.
The key pair belongs to the receiver in this example. Alice does not use her own public key to make a message readable only by Bob.
If Bob sends a confidential reply to Alice using asymmetric encryption, he uses Alice’s verified public key, and she decrypts with her private key.
Verifying the public key matters. If an attacker substitutes their own key while pretending it is Bob’s, Alice could encrypt for the attacker. Public availability alone does not establish ownership.
08 | COMPARE THE METHODS
| Feature | Symmetric | Asymmetric |
|---|---|---|
| Keys | One shared secret key | A public/private key pair |
| Encryption for a receiver | Shared secret key | Receiver’s public key |
| Decryption | Same shared secret key | Receiver’s private key |
| What remains secret? | Shared key | Private key |
| Key distribution | Shared key needs a secure arrangement | Public key can be distributed, but ownership must be verified |
| Typical performance | Efficient for bulk data | Generally more computationally demanding for comparable security |
| Useful role | Protecting large data transfers | Supporting secure establishment of communication and small confidential exchanges |
Do not say asymmetric encryption is always “more secure”. Security depends on the algorithm, key size, implementation, key protection and correct use.
09 | WHY SYSTEMS OFTEN COMBINE THEM
A secure connection can use asymmetric techniques to establish or protect session keys, then symmetric encryption to protect the main data transfer. This combines useful key-establishment properties with efficient bulk encryption.
That is an extension of the core syllabus distinction. Modern protocols can use key agreement rather than simply sending a symmetric key encrypted with a public key. You do not need to assume one exact handshake for every secure connection.
The shared session key is still secret. Asymmetric techniques do not make it acceptable to publish the key protecting the main data.
10 | WHAT ENCRYPTION DOES NOT PROVE
Encryption protects confidentiality. Encryption alone does not necessarily prove who sent the message, detect every alteration or guarantee delivery. Secure systems use additional mechanisms for authentication, integrity and reliable transmission.
Do not confuse encryption with compression or hashing. Compression reduces size; a hash produces a value used for purposes such as comparison and is not decrypted back into the original message.
Digital signatures are also a separate use of asymmetric cryptography. Do not describe confidential encryption as “encrypt with your private key so everyone can read it with your public key”.
Once the receiver decrypts the data, it must still be protected on that device. Encryption in transit does not automatically protect an unlocked screen or an exposed private key.
11 | COMMON MISTAKES
- Calling ciphertext the original: plaintext is unencrypted; ciphertext is encrypted.
- Sharing the symmetric key openly: an interceptor could decrypt the data.
- Keeping the public key secret but publishing the private key: the private key must remain secret.
- Using the sender’s public key for delivery: encrypt for the receiver with the receiver’s verified public key.
- Saying public-key encryption proves identity: ownership of the key must be established.
- Calling a shift cipher secure: it is only a teaching model.