Docs

Topic 2 · Data transmission

Encryption

Why data is encrypted, and how symmetric and asymmetric encryption use keys to keep it secret.

Lesson 3 of 3Syllabus 2.3updated October 31, 2026

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.

  1. 1
    Plaintext
    MEET AT 3
  2. 2
    Encrypt with a key
    Algorithm + key
  3. 3
    Ciphertext
    X9#q!2Lm@, safe to send
  4. 4
    Decrypt with a key
    Back 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.

SymmetricAsymmetric
KeysOne shared secret keyPublic key and private key
Encrypt withThe secret keyThe receiver's public key
Decrypt withThe same secret keyThe receiver's private key
Main problemSharing the key safelySlower 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.