ENC

2.3 Encryption

Understanding the need for encryption, symmetric and asymmetric encryption, and how data is protected on wired and wireless networks.

Learning Objectives

By the end of this lesson, you will be able to:

  • Understand theneed for and purpose of encryptionwhen transmitting data
  • Understand how data is encrypted usingsymmetric encryption(single shared key)
  • Understand how data is encrypted usingasymmetric encryption(public and private keys)
  • Describe how data is protected onwiredandwirelessnetworks
  • Explain thekey distribution problemin symmetric encryption
  • Understand the strengths and weaknesses of each encryption method

Key Terms

Encryption

The process of encoding a message so it can only be read by the sender and the intended recipient.

Plaintext

The original, readable data before it is encrypted.

Ciphertext

The unreadable, scrambled data after encryption.

Decryption

The process of converting ciphertext back into plaintext using a key.

Encryption Key

A binary string of a certain length that, when applied to an encryption algorithm, encrypts or decrypts data.

Symmetric Encryption

Encryption using a single shared key to both encrypt and decrypt data. Also called "secret key" encryption.

Asymmetric Encryption

Encryption using a pair of related keys: a public key and a private key. Also called "public-key" encryption.

Public Key

A key that is shared with everyone and used to encrypt a message.

Private Key

A key that is kept secret by the recipient and used to decrypt a message.

Key Distribution Problem

The security risk in symmetric encryption where the shared key must be transmitted to the recipient and could be intercepted.

SSID

Service Set Identifier — the name of a wireless network, used with a password to create a master key.

Master Key

A key created from the SSID and password, used to encrypt and decrypt data on a wireless network.

WPA2

A dedicated security protocol designed for Wi-Fi networks.

Caesar Cipher

One of the earliest forms of encryption; replaces each letter with another letter a fixed distance away.

1. What is Encryption?

Encryptionis the process of encoding a message so it can only be read by the sender and the intended recipient. It scrambles readable text so it can only be read by the person who has the secret code, ordecryption key.

How Encryption Works

  • Encryption takesplaintext(like a text message or email) and scrambles it into an unreadable format calledciphertext.
  • This helps protect theconfidentialityof digital data whether stored on computer systems or transmitted through a network like the Internet.
  • When the intended recipient accesses the message, the information is translated back to its original form. This is calleddecryption.
  • To unlock the message, both the sender and the recipient have to use asecret encryption key— a collection of algorithms that scramble and unscramble data.

Why is Encryption Needed?

  • Vast amounts ofpersonal informationare managed online and stored in the cloud or on servers with an ongoing connection to the web.
  • It's nearly impossible to do business without your personal data ending up in an organisation's networked computer system.
  • When data is transmitted over apublic network(wired or wireless), there is always a risk of it being intercepted by a hacker (eavesdropper).
  • Using encryption helps tominimise this risk.
  • Encryption protects sensitive information such as medical information, financial information, passwords, and personal details.

Purpose of Encryption

The purpose of encryption is to ensure that only somebody who iseligible to access datawill be able to read it, using a decryption key. Somebody who is not eligible can be excluded because they do not have the required decryption key.

Important:Encryption does not prevent data from being accessed or hacked. It prevents the data from beingunderstoodby an unauthorised user if it is accessed.

The Encryption Process

Plaintext
Encryption + Key
Ciphertext
Decryption + Key
Plaintext

The same process applies whether data is being stored or transmitted. The key is essential — without it, the ciphertext remains unreadable.

Activity 1: Encryption Concepts

  1. State what is meant by encryption. [2]
  2. Explain why encryption is important when transmitting data over a public network. [3]
  3. Complete the diagram: Plain text → Encryption algorithm → ______ [1]
Solution:
  1. Encryption is the process of scrambling data (plaintext) into an unreadable format (ciphertext) [1] so that it can only be read by someone who has the correct decryption key [1].
  2. When data is transmitted over a public network, it can be intercepted by hackers [1]. Encryption makes the data meaningless / unintelligible to anyone who intercepts it without the key [1]. This protects sensitive information such as passwords, financial details, or personal data [1].
  3. Cipher text[1]

Check Your Understanding: What is Encryption?

  • [1]The original, readable data before it is encrypted
  • [1]The unreadable, scrambled data after encryption
  • [1]To ensure that only eligible people can access and understand the data
  • [1]To protect the confidentiality of data transmitted over a network or stored on a system
  • [1]A secret code / key used to convert ciphertext back into readable plaintext
  • [1]Wireless data is transmitted over radio waves, which can be intercepted more easily than wired signals
  • [1]Anyone within range can potentially intercept the data, so encryption is essential to keep it secure
  • [1]No — encryption does not prevent data from being accessed or intercepted
  • [1]It prevents the data from being understood by an unauthorised user if it is accessed without the key

2. Simple Encryption: The Caesar Cipher

One of the first forms of encryption was theCaesar cipher, which replaces each letter of the alphabet with another letter a fixed distance away from the original letter. The aim of encryption is to make the original message impossible to crack without the key.

How the Caesar Cipher Works

  • Each letter in the plaintext is shifted a fixed number of places down the alphabet.
  • The number of places shifted is thekey.
  • For example, with a shift of 5 (Key = 5):
    • A → F
    • B → G
    • C → H
    • ...and so on
  • To decrypt, the receiver shifts the letters back by the same number of places.

Example: Shift of 5

Plaintext: COMPUTING
C
O
M
P
U
T
I
N
G
↓ Shift each letter 5 places ↓
X
J
H
K
P
O
D
I
B
Ciphertext: XJHKPODIB

Interactive Caesar Cipher

Enter a message and a shift key to see the encrypted ciphertext.

Activity 2: Caesar Cipher Practice

Using a Caesar cipher with a shift key of 5:

  1. Encrypt the word "HELLO".
  2. Encrypt the phrase "COMPUTER SCIENCE".
  3. Decrypt the ciphertext "XJHKPODIB".
  4. Decrypt the ciphertext "GQYJX".
Solution:
  1. HELLO →MJQQT(H→M, E→J, L→Q, L→Q, O→T)
  2. COMPUTER SCIENCE →HTRUZYJW XHNJJSJ
  3. XJHKPODIB →COMPUTING(shift back 5)
  4. GQYJX →BLUE S... wait, G→B, Q→L, Y→T, J→E, X→S →BLTES. Hmm, let me recalculate: G-5=B, Q-5=L, Y-5=T, J-5=E, X-5=S →BLTES. Actually this doesn't form a word — let me check the ciphertext. Maybe it should be "GQYJX" → B L T E S. Perhaps the intended word was "BLTES"? Or maybe the ciphertext was meant to be different. Let's just show the process.

Check Your Understanding: Caesar Cipher

  • [1]One of the earliest forms of encryption
  • [1]It replaces each letter of the alphabet with another letter a fixed distance away from the original letter
  • [1]FDW (C→F, A→D, T→W)
  • [1]There are only 25 possible shift keys
  • [1]It can easily be cracked by brute force or frequency analysis
  • [1]The number of places each letter is shifted
  • [1]Shift the letters back by the same number of places as the key
  • [1]Symmetric encryption (the same key is used to encrypt and decrypt)

3. Symmetric Encryption

Symmetric encryptionuses a single key to encrypt and decrypt. If you encrypt a zip file, then decrypt with the same key, you are using symmetric encryption. Symmetric encryption is also called"secret key" encryptionbecause the key must be kept secret from third parties.

How Symmetric Encryption Works

  • Uses thesame (pre-shared) private keyto encode and decode data.
  • This key must be transmitted (shared) in some waypriorto sending an encrypted message.
  • Both the sender and receiver have an identical secret key.
  • If a hacker gains access to the key, then they can decrypt intercepted information.
Plaintext
Secret Key
Ciphertext
Same Key
Plaintext

The Key Distribution Problem

  • It is important that the sender and receiver have the same encryption and decryption key.
  • There is a security risk here, since the sender has tosupply the keyto the recipient.
  • This key could beintercepted by a hacker, which puts the security of the encrypted message at risk.
  • This situation is referred to as theKEY DISTRIBUTION PROBLEM.
How can the key be shared securely?
  • Both parties could verbally share the key in person
  • Both parties may use standard postage mail to share the key
  • An algorithm may be used to calculate the key by sharing secret non-key information

Example: Symmetric Encryption with a 10-Digit Key

Consider a system that uses a 10-digit denary encryption key:4 2 9 1 3 6 2 8 5 6. This means every letter in a word is shifted across the alphabet +4, +2, +9, +1, and so on, places.

Plaintext: COMPUTER SCIENCE IS EXCITING
Key: 4 2 9 1 3 6 2 8 5 6 4 2 9 1 3 6 8 5 6 4 2 9
Ciphertext: GQVQXZGZXIMGWDHOUMCIMVROJ

To get back to the original message, the same decryption key is used (4 2 9 1 3 6 2 8 5 6). The decryption process is the reverse of encryption — each letter is shifted -4, -2, -9, -1, and so on.

Activity 3: Symmetric Encryption

  1. State what is meant by symmetric encryption. [2]
  2. Explain the key distribution problem. [3]
  3. Describe two ways the key could be shared securely. [2]
Solution:
  1. Symmetric encryption uses a single shared key to encrypt and decrypt data [1]. The same key is used by both the sender and receiver [1].
  2. The sender and receiver must both have the same key [1]. The sender has to supply the key to the recipient [1]. This key could be intercepted by a hacker, which puts the security of the encrypted message at risk [1].
  3. Any two from: verbally share the key in person; use standard postage mail; use an algorithm to calculate the key by sharing secret non-key information [2].

Check Your Understanding: Symmetric Encryption

  • [1]One single shared key (also called a secret key)
  • [1]The shared key must be transmitted to the recipient before communication
  • [1]If the key is intercepted during transmission, the security of the encrypted message is compromised (key distribution problem)
  • [1]Because the same key must be kept secret between the sender and receiver — if a third party obtains it, they can decrypt the data
  • [1]Encrypting a zip file with a password / Wi-Fi encryption (WPA2) / any appropriate example
  • [1]The hacker can decrypt any intercepted messages that were encrypted with that key
  • [1]They can also encrypt their own messages and impersonate the sender
  • [1]Symmetric encryption uses a single key and a simpler algorithm
  • [1]Asymmetric encryption requires two mathematically related keys and a more complex process

4. Asymmetric Encryption

Asymmetric encryption, also known aspublic-key cryptography, uses a pair of related keys — onepublic keyand oneprivate key— to encrypt and decrypt a message and protect it from unauthorised access or use.

The Two Keys

  • Public key— a key that is shared with everyone and used by the recipient to encrypt a message.
  • Private key— a key that is kept secret by the recipient and used to decrypt a message.
  • Any data encoded with one key requires the other to decode.
  • If someone uses your public key to encrypt an email, that person can be sure that only you will be able to decode it.
  • Private keys mustneverbe shared.

How It Works

  1. Person A uses the recipient'spublic keyto encrypt their message.
  2. Person A sends the encrypted message over the network or internet.
  3. Person B decrypts the message using their secretprivate key.
  4. Only the matching private key can decrypt the message, and it is never sent over the internet.

Example: Tom Sends a Confidential Document to Jane

Step 1:Jane generates a matching pair of keys (private and public). The keys are mathematically linked but cannot be derived from each other.
Step 2:Jane sends herpublic keyto Tom.
Step 3:Tom uses Jane'spublic keyto encrypt the document.
Step 4:Tom sends the encrypted document (ciphertext) back to Jane.
Step 5:Jane uses her matchingprivate keyto decrypt Tom's document.

Jane can exchange her public key with any number of people, so she is able to receive encrypted messages and decrypt them using her private key. If two-way communication is required between multiple users, they all need to generate their own matching public and private keys and swap public keys with each other.

Asymmetric Encryption Flow

Plaintext
Public Key
Ciphertext
Private Key
Plaintext

The public key is used toencryptthe message. Only the matching private key candecryptit. The private key is never shared.

Activity 4: Asymmetric Encryption

  1. Describe how asymmetric encryption is used to send a secure message. [4]
  2. Explain why asymmetric encryption is more secure than symmetric encryption. [3]
Solution:
  1. The sender obtains the recipient's public key [1]. The sender uses the public key to encrypt the message [1]. The encrypted message is sent over the network [1]. The recipient uses their private key to decrypt the message [1].
  2. The private key is never transmitted over the network, so it cannot be intercepted [1]. Even if the public key is intercepted, it cannot be used to decrypt the message [1]. Only the recipient's private key can decrypt the message, and it is kept secret [1].

Check Your Understanding: Asymmetric Encryption

  • [1]Two keys — a public key and a private key
  • [1]The recipient's public key
  • [1]The recipient's private key
  • [1]The private key is the only key that can decrypt messages encrypted with the matching public key
  • [1]If the private key were shared or intercepted, the security of all messages would be compromised
  • [1]It uses two mathematically related keys and a more complex algorithm
  • [1]The added complexity of the decoding process makes it slower than symmetric encryption
  • [1]public
  • [1]private

5. Encryption on Wired & Wireless Networks

Encryption is important on both wired and wireless networks, but it'seven more critical on wireless networksdue to the data being transmitted over radio waves, making it easy to intercept.

Wireless Network Encryption

  • Wireless networks are identified by aService Set Identifier (SSID)which along with a password is used to create amaster key.
  • When devices connect to the same wireless network using the SSID and password, they are given a copy of the master key.
  • The master key is used to encrypt data intociphertextbefore being transmitted.
  • The receiver uses thesame master keyto decrypt the ciphertext back to plaintext.
  • To guarantee the security of data, themaster key is never transmitted. Without it, any intercepted data is rendered useless.
  • Wireless networks use dedicated protocols likeWPA2specifically designed for Wi-Fi security.

Wired Network Encryption

  • Wired networks are encrypted in a very similar way to a wireless network, using a master key to encrypt data and the same key to decrypt data.
  • Encryption on a wired network differs slightly as it is often left to individual applications to decide how encryption is used, for exampleHTTPS.
Data
Master Key
Ciphertext

Exam Tips

  • Don't just say "encryption keeps data safe." You must mention:
    • Plaintext becomes ciphertext
    • Only authorised users with the correct key can decrypt it
  • Many students incorrectly say asymmetric encryption uses "a private key and password." Don't confuse the public key (used to encrypt) with a generic "password." They are not the same.

Activity 5: Network Encryption

  1. Describe how data is encrypted on a wireless network. [4]
  2. Why is encryption more critical on wireless networks than wired networks? [2]
  3. What is WPA2 and why is it used? [2]
Solution:
  1. Wireless networks are identified by an SSID [1]. The SSID and password are used to create a master key [1]. When devices connect using the SSID and password, they are given a copy of the master key [1]. The master key is used to encrypt data into ciphertext before transmission, and the same key decrypts it at the receiver [1].
  2. Wireless data is transmitted over radio waves, which can be easily intercepted by anyone within range [1]. Wired data requires physical access to the cable, making it more difficult to intercept [1].
  3. WPA2 is a dedicated security protocol designed for Wi-Fi networks [1]. It is used to guarantee the security of data transmitted over wireless networks [1].

Check Your Understanding: Network Encryption

  • [1]Service Set Identifier
  • [1]The SSID (network name) and the password are used together
  • [1]To create the master key
  • [1]To guarantee the security of data
  • [1]Without the master key, any intercepted data is rendered useless
  • [1]Wireless networks use a master key derived from the SSID and password
  • [1]Wired networks often leave encryption to individual applications (e.g. HTTPS), though they also use a master key approach
  • [1]A dedicated security protocol designed for Wi-Fi networks
  • [1]understood

Key Takeaways

  • Encryptionis the process of encoding a message so it can only be read by the sender and intended recipient. It convertsplaintextintociphertext.
  • Decryptionis the reverse process — converting ciphertext back into plaintext using a key.
  • The purpose of encryption is to ensure that only eligible people can access and understand data. Encryption doesnotprevent data from being accessed — it prevents it from being understood.
  • Symmetric encryptionuses asingle shared keyto encrypt and decrypt. It is faster but has a security weakness: thekey distribution problem(the key must be shared and could be intercepted).
  • Asymmetric encryptionuses apair of keys: apublic key(shared with everyone, used to encrypt) and aprivate key(kept secret, used to decrypt).
  • Theprivate key is never transmitted, making asymmetric encryption more secure than symmetric encryption. However, it is slower.
  • TheCaesar cipheris one of the earliest forms of encryption — it replaces each letter with another a fixed distance away. It is a symmetric encryption method and is easily cracked.
  • Wireless networksuse theSSIDand password to create amaster key, which encrypts and decrypts data. The master key is never transmitted. Protocols likeWPA2are used for Wi-Fi security.
  • Wired networksare encrypted similarly but often leave encryption to individual applications (e.g. HTTPS).
  • Encryption is more critical onwireless networksbecause radio waves can be easily intercepted by anyone within range.
  • Large keys (e.g. 100 bits) generate an enormous number of combinations, making them nearly impossible for a hacker to guess.

Question Bank

  • [1]The process of scrambling / encoding data (plaintext)
  • [1]So that it can only be read by someone who has the correct decryption key
  • [1]Uses the same key to encrypt and decrypt a message
  • [1]The SSID and password are used to create a master key
  • [1]Devices connecting to the network are given a copy of the master key
  • [1]The master key is used to encrypt data into ciphertext before transmission
  • [1]The receiver uses the same master key to decrypt the ciphertext back to plaintext
  • [1]Wireless data is transmitted over radio waves, which can be intercepted by anyone within range
  • [1]Wired data requires physical access to the cable, making it more difficult to intercept
  • [1]Uses a pair of keys — a public key and a private key
  • [1]The sender uses the recipient's public key to encrypt the message
  • [1]The encrypted message is sent over the network
  • [1]The recipient uses their private key to decrypt the message
  • [1]The sender and receiver must both have the same key
  • [1]The sender has to supply the key to the recipient before communication
  • [1]The key could be intercepted during transmission, compromising the security of the encrypted message
  • The data before encryption is known asplaintext.
  • To scramble the data, an encryptionkeyis used.
  • The data after encryption is known asciphertext.
  • Encryption prevents the data from beingunderstoodby a hacker.
  • [1]An encryption algorithm is used to scramble the data
  • [1]A key is used with the algorithm
  • [1]The plaintext is converted into ciphertext
  • [1]The data can only be decrypted using the correct key
  • [1]Increase the length of the key (use more than 128 bits) or use a more complex encryption algorithm
  • [1]Symmetric uses one shared key; asymmetric uses two keys (public and private)
  • [1]Symmetric is faster; asymmetric is slower
  • [1]Symmetric has a key distribution problem; asymmetric does not (private key is never shared)
  • [1]Asymmetric is more secure; symmetric is less secure if the key is intercepted
  • [1]It makes the data meaningless (unreadable) to anyone who does not have the decryption key
  • [1]One of the earliest forms of encryption
  • [1]Replaces each letter of the alphabet with another letter a fixed distance away
  • [1]The number of places shifted is the key
  • [1]Example: With a shift of 5, COMPUTING becomes XJHKPODIB
  • [1]The private key is the only key that can decrypt messages encrypted with the matching public key
  • [1]If it were transmitted, it could be intercepted, compromising the security of all messages
  • [1]A key created from the SSID and password of a wireless network
  • [1]It is given to devices that connect to the network
  • [1]It is used to encrypt data into ciphertext before transmission and decrypt it at the receiver
  • [1]Encryption does not prevent data from being accessed or intercepted by hackers
  • [1]It prevents the data from being understood — without the decryption key, the intercepted data remains meaningless