COMP5563 Chap.1 Cryptographic Foundations and the One-Time Pad
Cryptographic Foundations and the One-Time Pad
Start with the property
Cryptography protects several different properties. Confidentiality asks who can read a message, integrity asks who can alter it, and authentication asks who created it.
Public algorithms and secret keys make these claims testable against an explicit attacker rather than dependent on obscurity.
The exact benchmark
The one-time pad encrypts an n-bit message by XORing it with a uniform independent n-bit key. For a fixed ciphertext, every candidate message has exactly one compatible key with equal probability, so the observation does not change message probabilities.
The guarantee fails when the pad is biased, short or reused, and ordinary ciphertext length still reveals message length unless an encoding hides it.
Analyse the observation
Begin with what the adversary sees and which candidates remain possible. Historical substitution preserves language frequency, so nominal key-space size does not stop efficient ranking.
A one-time pad removes that distributional evidence only under a uniform independent key. Security is therefore a probability statement, not a judgement that output looks scrambled.
Financial formats supply structure
Payment records contain predictable headers, currency codes and fixed field positions. Reused key material lets known bytes reveal matching positions in another message.
Distinct record lengths can identify transaction types even under fresh pads. Encoding and padding decide which metadata is inside the secrecy claim.
Answer with algebra
Write encryption and decryption, prove correctness by XOR cancellation, then treat secrecy separately. For reuse, XOR two ciphertexts and remove the key. For length leakage, identify the visible class.
Close by naming the violated condition and the exact information gained.
What this chapter covers
- 01
Security goals and attacker models
- 02
Historical substitution and transposition leakage
- 03
XOR correctness
- 04
Perfect secrecy as unchanged probability
- 05
Uniform independent single-use keys
- 06
Key reuse and length leakage
Worked example · free
Recover a relation from a reused five-bit pad
- 2XOR the two ciphertexts.
- 2Explain why the key cancels.
- 2XOR the known first message into the relation.
Key terms
- Perfect Secrecy
- Ciphertext observation leaves every plaintext probability unchanged.
- One-Time Pad
- XOR encryption with a uniform independent key as long as the message and used once.
- Key Reuse
- Applying secret material again where the theorem requires a fresh independent value.
Cryptographic Foundations and the One-Time Pad FAQ
Why is a huge key space not automatically secure?
An attacker may use language frequency, structural invariants or other evidence to discard most keys without searching them uniformly. Key-space size measures generic exhaustive search only when no shortcut exploits the construction or the message distribution.
Does an OTP ciphertext look random because XOR is secure?
Uniform independent key bits make the ciphertext distribution uniform for every fixed plaintext. XOR alone supplies correctness and cancellation algebra. XOR with zero, a biased key or a repeated key does not provide the same secrecy.
Can perfect secrecy hide message length?
Not automatically. If ciphertext length follows plaintext length, an observer learns a length class even when the content is perfectly hidden within that class. Fixed-length records or padding to a common bound are separate encoding choices.
Why is the one-time pad mainly a benchmark?
Its proof is exact, but its operations demand uniform secret material as long as every message, secure distribution before use, reliable synchronisation and destruction after use. Those requirements are difficult for high-volume financial traffic. Modern ciphers replace the long pad with computational assumptions while retaining strict rules about keys, state and encoding.
Exam move
Reconstruct the perfect-secrecy argument from a four-row table containing candidate messages, compatible keys, prior probabilities and posterior probabilities. Change one assumption at a time: bias the key, shorten it, repeat it or expose length, then state exactly which row changes. Practise XOR by hand until cancellation is immediate.
For every historical cipher, identify the preserved structure rather than memorising a name. Finish each attack with a probability statement or a recovered relation. When reviewing financial examples, label confidentiality, integrity and authentication separately before selecting a primitive. This prevents a common error in which encryption is credited with every security property.
On a closed-book question, begin with the adversary's observation, not with implementation advice. Then write the algebra and conclude whether the observation changes candidate-message probabilities. Next, compare one example with a proof. The example checks a five-bit calculation, while the proof must cover the full message distribution. List which statement establishes correctness and which establishes secrecy.
Finally, take a familiar payment record and mark every predictable byte and visible length class. Explain how reuse exposes matching positions and how fixed-length encoding changes the observation. This closes the gap between the abstract pad and a structured financial message.
Working through Cryptographic Foundations and the One-Time Pad in COMP5563? Sia is AskSia’s AI Computer Science tutor — ask any COMP5563 Cryptographic Foundations and the One-Time Pad question and get a clear, step-by-step explanation grounded in how COMP5563 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.