Skip to content

Symmetric and Asymmetric Encryption

1.3.1 Compression, encryption and hashing · Paper 1 · 7 flashcards · 2 questions

Encryption transforms readable data (plaintext) into an unreadable format (ciphertext) to protect it from unauthorised access. Understanding the two main approaches is crucial for computer science.

Definition
Encryption is the process of encoding data so that only authorised parties can read it. The original data (plaintext) is transformed into encrypted data (ciphertext) using an algorithm and a key.

Symmetric Encryption

In symmetric encryption, the same key is used for both encryption and decryption. This is like having a single key that both locks and unlocks a door.

Definition
Symmetric encryption uses a single shared key for both encrypting and decrypting data. Both the sender and recipient must possess the same secret key.
Worked Example
Worked Example: Symmetric Encryption Process

Scenario: Alice wants to send a secret message to Bob

Step 1: Alice and Bob agree on a secret key (e.g., "SECRET123")
• This must happen through a secure channel

Step 2: Alice encrypts her message
• Plaintext: "Meet at noon"
• Key: "SECRET123"
• Ciphertext: "Xk3$p@9nLm2!" (unreadable)

Step 3: Alice sends ciphertext to Bob (can use insecure channel)

Step 4: Bob decrypts using the same key
• Ciphertext: "Xk3$p@9nLm2!"
• Key: "SECRET123"
• Plaintext: "Meet at noon"

The Problem: How do Alice and Bob securely share the key in the first place? If an attacker intercepts the key, they can decrypt all messages.
Key Point
Symmetric Encryption Characteristics:
• Fast - suitable for encrypting large amounts of data
• Simple - one key to manage
• Problem: Key distribution - how to share the key securely?
• If key is compromised, all data encrypted with it is vulnerable
• Examples: AES (Advanced Encryption Standard), DES

Asymmetric Encryption

Asymmetric encryption uses two mathematically related keys - a public key and a private key. What one key encrypts, only the other can decrypt.

Definition
Asymmetric encryption uses a pair of keys: a public key (shared openly) and a private key (kept secret). Data encrypted with the public key can only be decrypted with the corresponding private key.
Worked Example
Worked Example: Asymmetric Encryption Process

Scenario: Alice wants to send a secret message to Bob

Step 1: Bob generates a key pair
• Public key: Can be shared with anyone
• Private key: Bob keeps this secret, never shares it

Step 2: Bob publishes his public key (website, email, etc.)

Step 3: Alice encrypts her message using Bob's PUBLIC key
• Plaintext: "Meet at noon"
• Bob's public key applied
• Ciphertext: "7h$kL@2mNp!" (unreadable)

Step 4: Alice sends ciphertext to Bob (can use insecure channel)

Step 5: Bob decrypts using his PRIVATE key
• Only Bob's private key can decrypt this
• Even Alice cannot decrypt it now!
• Plaintext: "Meet at noon"

Key insight: No secret key ever needs to be transmitted. The public key can be shared openly - knowing it doesn't help an attacker decrypt messages.
Key Point
Asymmetric Encryption Characteristics:
• Solves key distribution problem - public key can be shared openly
• Private key never transmitted - more secure
• Slower than symmetric - computationally intensive
• Enables digital signatures (encrypt with private key)
• Examples: RSA, Elliptic Curve Cryptography (ECC)

Comparison

Key Point
Keys
• Symmetric: 1 shared key
• Asymmetric: 2 keys (public + private)

Speed
• Symmetric: Fast
• Asymmetric: Slow

Key Distribution
• Symmetric: Difficult (must share secretly)
• Asymmetric: Easy (public key shared openly)

Best For
• Symmetric: Bulk data encryption
• Asymmetric: Key exchange, digital signatures

Security Risk
• Symmetric: Key interception
• Asymmetric: Private key theft
Exam Tip
Hybrid Encryption: Real-world systems like HTTPS use BOTH:
1. Asymmetric encryption to securely exchange a symmetric key
2. Symmetric encryption for the actual data (faster)
This combines the security of asymmetric with the speed of symmetric.

Choosing Between Symmetric and Asymmetric Encryption

The right method depends on whether the key has to be shared with anybody else.

Key Point
SituationSuitable methodReason
The same person or device encrypts and decrypts, such as encrypting a backup or the files stored on a deviceSymmetricThe key never has to be sent to anyone, so there is no key distribution problem, and it needs less processing
Data is sent to somebody else across a network, such as card details sent to a websiteAsymmetricOnly the public key is shared. The private key needed to decrypt the data never leaves its owner
A large amount of data is exchanged across a network, such as a secure web sessionBothAsymmetric encryption is used to exchange a symmetric key, which then encrypts the data quickly