CyberQuest - POGIL Activity

Perfect Secrecy and the One-Time Pad

A guided-inquiry activity for Day 3 (Cryptography). Work in a team of 3 to 4, or on your own. Read each Model, then answer the Critical Thinking Questions in order before peeking at the hints.

Learning objectives

Prerequisites: the XOR operation and binary basics (Day 3, Module 2).

Team roles

Manager - keeps time, makes sure everyone participates, and keeps the team on task.
Recorder - writes the team's agreed answers and notes any questions to ask.
Presenter - speaks for the team and shares answers with the class.
Reflector - watches how the team works together and suggests one improvement.

Model 1: XOR and the one-time pad

XOR (exclusive or) compares two bits and outputs 1 only when the bits differ.

aba XOR b
000
011
101
110

A one-time pad encrypts by XOR-ing the message with a random key of the same length.

bits
message101100
key (random)011010
ciphertext110110
  1. Using the XOR table, verify the ciphertext row in Model 1 for the first two bit columns.
    Check your thinking

    Column 1: 1 XOR 0 = 1. Column 2: 0 XOR 1 = 1. Both match the ciphertext row.

  2. To decrypt, the receiver XORs the ciphertext with the same key. Compute ciphertext XOR key for the first two columns. What do you get?
    Check your thinking

    Column 1: 1 XOR 0 = 1. Column 2: 1 XOR 1 = 0. You recover the original message bits 1 then 0.

  3. What does this show about XOR-ing by the same key twice?
    Check your thinking

    It cancels out: (m XOR k) XOR k = m. Applying the same key twice returns the original.

Model 2: Why the ciphertext tells you nothing

Take the 6-bit ciphertext 110110 from Model 1. A different 6-bit key produces a different message.

ciphertext110110
guess key A011010
gives message101100
guess key B110101
gives message000011

For every possible message, there is exactly one key that produces this ciphertext.

  1. From Model 2, if the attacker has only the ciphertext, can they tell which message was sent? Why or why not?
    Check your thinking

    No. Every possible message is equally possible because some key maps to it. The ciphertext alone gives no information about the message.

  2. Write your own one-sentence definition of perfect secrecy.
    Check your thinking

    Perfect secrecy means the ciphertext reveals nothing about the plaintext: seeing the ciphertext does not change what the attacker believes the message could be.

  3. List the three requirements a key must meet for a one-time pad to be perfectly secret.
    Check your thinking

    1) truly random, 2) at least as long as the message, 3) used only once and then destroyed.

  4. Why must the key be as long as the message?
    Check your thinking

    If the key were shorter it would have to repeat or be reused, which leaks patterns. A key as long as the message lets every message stay equally possible.

  5. Suppose the same key is used for two messages, giving ciphertexts C1 and C2. What does C1 XOR C2 equal, and why is that bad?
    Check your thinking

    C1 XOR C2 = M1 XOR M2, because the shared key cancels. That leaks the relationship between the two messages and can reveal both. This is why a one-time pad must be used only once.

  6. If the one-time pad is unbreakable, why is it rarely used in practice?
    Check your thinking

    The key must be truly random, as long as all the data, used once, and shared secretly in advance. Distributing that much key material safely is impractical, so real systems use AES with short keys instead.

Do it now

Open Day3.ipynb, run the XOR cell, and confirm that XOR-ing twice with the same key returns the original. Then try encrypting two short messages with the same key and XOR the two ciphertexts together to see the key cancel out.

Application

A teammate suggests reusing one strong random key all week to save effort. Using your conclusion from Model 2, explain the risk in two sentences.