Chapter 2

Encryption

Learn how encryption scrambles plaintext into ciphertext, and compare symmetric and asymmetric keys that keep data private.

Why we encrypt data

When data is sent across a network it can be intercepted. Encryption scrambles data so that anyone who intercepts it sees only meaningless symbols. It does not stop interception — it makes the stolen data useless without the correct key. The original readable data is called plaintext; the scrambled version is ciphertext.

Key idea

A key is the secret value used with an algorithm to turn plaintext into ciphertext and back again.

Symmetric encryption

In symmetric encryption the same key is used to encrypt and to decrypt the data. It is fast, but the key itself must be shared secretly — if an attacker gets the key, the encryption is broken. Safely delivering that key to the right person, without anyone intercepting it, is the biggest challenge of this method.

Asymmetric encryption

Asymmetric encryption uses a pair of keys: a public key that anyone may use to encrypt a message, and a matching private key kept secret by the receiver to decrypt it. Because the private key is never shared, data can be sent securely even to someone you have never contacted before. This is how banks and online shops protect information such as passwords: your browser encrypts the details with the site's public key, and only the site's private key can unlock them.

Remember

  • Plaintext, then encryption, gives ciphertext; decryption returns the plaintext.
  • Symmetric = one shared key; asymmetric = a public and private key pair.
  • Encryption protects the meaning of data, not against it being intercepted.

Stuck on this topic? A verified JomKelas tutor can walk you through it.

Find a verified tutor