Year 10 · Computer Science · Autumn 2

Data transmission and Boolean logic · Lesson 4 of 5

Encryption: symmetric and asymmetric

Theory2.3 Encryption

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

You will learn to

  • Explain why data is encrypted before it is sent: intercepted data cannot be understood.
  • Describe symmetric encryption and the problem of sharing the key safely.
  • Describe asymmetric encryption, using a public key and a private key.

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

Success criteria

You have got it when you can say:

  • I can encrypt and decrypt a word with a Caesar cipher, and say it is symmetric.
  • I can explain why sending the secret key with the message is risky.
  • I can say which key encrypts a message sent to me, and which key decrypts it.

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

Retrieval starter

Questions from before. Write your answers, then show them.

  1. Last lesson

    X = (A AND B) OR C with A = 0, B = 1, C = 1 gives…

    A 1B 0C Cannot tell

    A. 1

  2. Last unit

    How many bits are in a byte?

    A 4B 8C 16

    B. 8

  3. Earlier this unit

    A packet's header holds…

    A The sender's and receiver's addresses and the packet numberB Only the dataC The whole file

    A. The sender's and receiver's addresses and the packet number

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

Key words

Check digit
A digit calculated from the other digits of a number, used to catch typing errors.
Symmetric encryption
Encryption where the same key encrypts and decrypts.
Asymmetric encryption
Encryption using a public key to encrypt and a matching private key to decrypt.

The explanation · step 1 of 3 · part 1 of 2

Why encrypt?

Data sent over a network can be intercepted: someone can copy it on the way, for example on public Wi-Fi.

Encryption scrambles the data using a key, so that an interceptor cannot understand it.

The readable data is called plaintext. The scrambled data is called ciphertext.

The explanation · step 1 of 3 · part 2 of 2

Why encrypt? (continued)

?Why?

Encryption does not stop data being intercepted. It makes intercepted data useless to the thief, which protects passwords, card numbers and private messages.

!Watch out

Exam answers lose marks for saying encryption stops hacking or interception. Say it makes the data meaningless without the key.

The explanation · step 2 of 3 · part 1 of 3

Symmetric encryption

In symmetric encryption, the same key is used to encrypt and to decrypt.

The sender and the receiver must both have this key. So the key itself must be shared.

The problem: if the key is intercepted while it is being sent, anyone can decrypt every message.

The explanation · step 2 of 3 · part 2 of 3

Symmetric encryption (continued)

e.g.Example
A Caesar shift is a very simple symmetric cipher. Key = 3: move each letter 3 places on. HELLO → KHOOR To decrypt, move each letter 3 places back with the same key. Try it in the toy: type HELLO as Alice's message with the key set to 3, and check you get KHOOR. Bob decrypts with the same key. Then change Bob's key and see nonsense.

The explanation · step 2 of 3 · part 3 of 3

Symmetric encryption (continued)

?Why?

Real symmetric encryption uses keys of 128 or 256 bits, so there are far too many keys to try. The weak point is sharing the key safely.

There is something to try for this step in the IGCSE library.

The explanation · step 3 of 3 · part 1 of 3

Asymmetric encryption

Asymmetric encryption uses two different keys that are made as a matched pair.

The public key is given to everyone. It is used to encrypt data sent to you.

The private key is kept secret by you and never sent. Only it can decrypt data that was encrypted with your public key.

The explanation · step 3 of 3 · part 2 of 3

Asymmetric encryption (continued)

e.g.Example
Ana wants to send Ben a secret message. 1. Ben sends Ana his public key. Anyone can see it; that is fine. 2. Ana encrypts the message with Ben's public key. 3. The ciphertext travels across the internet. 4. Only Ben's private key can decrypt it. Even Ana cannot decrypt it now. Try it in the toy: the sender is called Alice and the receiver Bob. Press Step to follow the message. Eve cannot open the box with the public key, but Bob opens it with his private key.

The explanation · step 3 of 3 · part 3 of 3

Asymmetric encryption (continued)

?Why?

This solves the key-sharing problem. The private key never travels, so it cannot be intercepted.

!Watch out

Do not say the private key encrypts the message to the receiver. For sending secret data, the receiver's public key encrypts and the receiver's private key decrypts.

There is something to try for this step in the IGCSE library.

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

Try it: Caesar cipher

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

Quick quiz · 1 of 3

A walkie-talkie, where only one side can talk at a time, is…

  1. A Simplex
  2. B Full-duplex
  3. C Half-duplex

C. Half-duplex

Both ways, but not at once. Full-duplex is both at once, like a phone.

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

Quick quiz · 2 of 3

With even parity, the 7 data bits 0110100 need the parity bit…

  1. A 1
  2. B 0
  3. C It cannot be worked out

A. 1

0110100 has three 1s, which is odd. A 1 makes the count even.

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

Quick quiz · 3 of 3

Parity can…

  1. A Detect two flipped bits
  2. B Detect one flipped bit but not fix it
  3. C Detect and fix any error

B. Detect one flipped bit but not fix it

Two flips keep the count even, so they slip through, and parity never says which bit flipped.

Year 10 · Computer Science · Data transmission and Boolean logic · Lesson 4 of 5

Exit ticket

Answer on paper before you go. Then check.

  1. In asymmetric encryption the message is locked with the…

    A Private keyB Public keyC Same key that unlocks it

    B. Public key Anyone can lock with the public key. Only the private key unlocks.

  2. ARQ stands for…

    A Automatic repeat requestB Average rate queryC Address resolution question

    A. Automatic repeat request The receiver acknowledges; if no acknowledgement arrives before the timeout, the sender resends.