Loading...
Encryption transforms plaintext into ciphertext using a cipher and key. Distinguish a toy substitution from a one-time pad whose secrecy depends on demanding assumptions.
What you'll be able to do
A Caesar cipher shifts each alphabet symbol by a fixed amount modulo the alphabet size. With A=0 through Z=25, a shift of three maps A to D and Z to C. Decryption reverses the shift. State how spaces, case and other symbols are treated in a particular example.
The small key space and preserved language patterns make the cipher easy to attack by trying shifts or examining frequency information. Replacing letters by numbers or hexadecimal does not strengthen the underlying substitution. Caesar is useful for illustrating a mechanism, not for modern confidentiality.
For bitwise Vernam encryption, ciphertext=plaintext XOR key. XORing the same key with the ciphertext recovers the plaintext because k XOR k=0. Work column by column with equal-length bit patterns. A known algorithm can still provide secrecy when its key conditions are satisfied.
A true one-time pad requires a uniformly random independent secret key at least as long as the message, used only once. Under those conditions it provides perfect secrecy. Reusing a pad or substituting a predictable stream removes that guarantee; securely distributing and storing the key is a major practical constraint.
Many practical ciphers rely on computational security: attacks are intended to require infeasible resources under explicit assumptions. That differs from the information-theoretic secrecy of a correctly used one-time pad. “Impossible to guess from any short example” is not a security proof.
Confidentiality is also different from integrity and authentication. A basic XOR pad does not itself prevent a ciphertext bit from being altered to change the corresponding plaintext bit. Use educational examples to understand the principles, without mistaking a toy implementation or a reused demonstration key for a secure deployed system.
| Operation | Bits |
|---|---|
| Plaintext | 101100 |
| Key | 011010 |
| Ciphertext, XOR | 110110 |
| Ciphertext XOR key | 101100 |
Attempt the task before opening its worked response. Record each change of state, explain the rule used, and check the result against the original requirements. Code examples labelled Python 3 use that language’s conventions; pseudocode states its own assumptions.
Common mistakes to avoid
Key takeaways
Test yourself
Answer a few questions, then review anything you missed.
Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.