Encryption

2026 Syllabus Objectives

By the end of this topic, you should be able to:

  1. Understand the need for and purpose of encryption when transmitting data
  2. Understand how data is encrypted using symmetric and asymmetric encryption (including the use of public and private keys)

What is Encryption and Why Do We Need It?

Encryption is a method of scrambling data before it is sent across a network.

Think of it like writing a message in a secret code. If someone intercepts the message, they can't read it because it looks like nonsense to them.

Why is encryption important?

When data travels across networks (like the internet), it can be intercepted by hackers. Encryption protects the data by making it meaningless to anyone who doesn't have the right "key" to unlock it.

Where is encryption especially important?

Encryption is important for both wired networks (cables) and wireless networks (Wi-Fi), but it's particularly critical for wireless networks because:

  • Wireless data travels through radio waves in the air
  • Anyone nearby with the right equipment can intercept these signals
  • It's much easier to "listen in" on wireless transmissions than wired ones

How Encryption Works: Basic Concepts

Before we look at the different types of encryption, let's understand some key terms:

Plaintext - This is the original data before it's encrypted. It's readable and makes sense. For example, the message "Hello" is plaintext.

Ciphertext - This is the scrambled data after encryption. It looks like random nonsense. For example, "X7$pQ2" might be the ciphertext version of "Hello."

Key - This is a special binary code (a string of 0s and 1s) that's used to encrypt and decrypt data. Think of it like a password, but much more complex. Keys can be different sizes - the longer the key, the more secure it is.

How keys work:

  • When applied to an encryption algorithm (a mathematical process), a key can scramble plaintext into ciphertext
  • The same key (or a related key) can unscramble ciphertext back into plaintext
  • Keys act like passwords that protect information

How Wireless Networks Use Encryption

Wireless networks follow a specific process to keep data secure:

Step 1: Creating the Master Key

  • Every wireless network has an SSID (Service Set Identifier) - this is the name of the Wi-Fi network you see when you try to connect
  • When you combine the SSID with the password, it creates something called a master key

Step 2: Sharing the Master Key

  • When you successfully connect to a wireless network by entering the correct password, your device receives a copy of the master key
  • Any device that connects to the same network gets the same master key

Step 3: Encrypting Data

  • Before data is sent from your device, the master key is used to encrypt it
  • The plaintext becomes ciphertext

Step 4: Decrypting Data

  • When the encrypted data reaches the receiver (like the wireless router or another device), they use their copy of the same master key to decrypt it
  • The ciphertext becomes plaintext again

Important security feature: The master key itself is NEVER sent over the wireless network. This means if a hacker intercepts your data, they only get ciphertext, which is useless without the master key.

Wireless networks typically use special protocols like WPA2 (Wi-Fi Protected Access 2), which is specifically designed for Wi-Fi security.

How Wired Networks Use Encryption

Wired networks (using cables) encrypt data in a very similar way to wireless networks:

  • They also use a master key to encrypt data
  • The same key is used to decrypt the data

The main difference:

  • With wired networks, individual applications often decide how to handle encryption
  • For example, when you visit a website that uses HTTPS (HyperText Transfer Protocol Secure), that "S" means the website is using encryption to protect your data

Symmetric Encryption

Symmetric encryption means using the same key to both encrypt and decrypt data.

How it works:

  1. The sender and receiver both have an identical secret key
  2. The sender uses this key to encrypt their message (plaintext → ciphertext)
  3. They send the encrypted message
  4. The receiver uses the same key to decrypt the message (ciphertext → plaintext)

The security problem: If a hacker somehow gets hold of the secret key, they can decrypt any intercepted messages. This is the main weakness of symmetric encryption.

How can the key be shared safely?

Since sending the key over the internet is risky, there are other ways to share it:

  • In person: The two people could meet and verbally share the key
  • By post: They could send the key through standard postal mail
  • Using mathematics: They could use a special algorithm that lets them calculate the same key by sharing some non-secret information

Advantages of symmetric encryption:

  • Fast - it's quick to encrypt and decrypt data
  • Simple - only one key is needed

Disadvantages of symmetric encryption:

  • The key must be shared securely before communication can begin
  • If the key is stolen or intercepted, all security is lost

Asymmetric Encryption

Asymmetric encryption uses TWO different keys: a public key and a private key.

The two keys:

  • Public key: This key is known to everyone - it's not secret. Anyone can have it.
  • Private key: This key is known only to the receiver - it's kept completely secret.

How it works:

  1. Person A wants to send a secure message to Person B
  2. Person A uses Person B's public key to encrypt the message (plaintext → ciphertext)
  3. Person A sends the encrypted message over the network
  4. Person B uses their private key to decrypt the message (ciphertext → plaintext)

Why is this secure?

  • The public key can only encrypt data - it cannot decrypt it
  • Only the matching private key can decrypt data that was encrypted with the public key
  • The private key is NEVER sent over the internet
  • Even if a hacker gets the public key, they can't decrypt the messages

How secure are these keys?

Keys can be extremely long. For example:

  • A key using 100 bits would create 1,267,650,600,228,229,401,496,703,205,376 different possible combinations
  • With this many possibilities, it's nearly impossible for a hacker to guess the correct key

Advantages of asymmetric encryption:

  • Very secure - the private key never needs to be transmitted
  • No need to meet in person to share keys
  • Even if someone gets the public key, they can't decrypt messages

Disadvantages of asymmetric encryption:

  • Slower than symmetric encryption
  • More complex to set up

Comparing Symmetric and Asymmetric Encryption

FeatureSymmetric EncryptionAsymmetric Encryption
Number of keysOne key (same for encryption and decryption)Two keys (public key for encryption, private key for decryption)
Key sharingThe secret key must be shared securelyOnly the public key is shared (the private key stays secret)
SpeedFastSlower
SecurityLess secure - if the key is stolen, all data can be decryptedMore secure - the private key is never transmitted
Use caseGood for encrypting large amounts of data quicklyGood for secure communication when you haven't met in person

Sign in to view full notes