Fundamentals of Cryptography
Cryptography is the science of protecting information from unauthorized access, tampering, or interception. In today’s digital world, it underpins everything from secure messaging to online…

In symmetric key cryptography, what is the relationship between the encryption and decryption keys?
A Caesar cipher shifts each letter forward by a fixed number of positions. If the shift key is 3, what is the ciphertext of the plaintext "HELLO"?
Which attack technique relies on having both some plaintext and its corresponding ciphertext?
Why is the One-Time Pad considered unconditionally secure?
Which of the following best characterizes a computationally secure cryptosystem?
During a brute-force attack on a symmetric cipher with a 128-bit key, how many possible keys must be tried in the worst case?
In the context of cryptanalysis, what is the primary purpose of frequency analysis?
Which of the following statements about asymmetric key cryptography is true?
What condition must be met for a One-Time Pad to remain perfectly secure?
Introduction to Cryptography
Cryptography is the science of protecting information from unauthorized access, tampering, or interception. In today’s digital world, it underpins everything from secure messaging to online banking. This course will walk you through the fundamental concepts, key terminology, and classic techniques that form the backbone of modern cryptographic practice.
Core Goal of Cryptography
The primary purpose of cryptography is to protect data from unauthorized access, tampering, or interception. Unlike the myth of “unbreakable codes” or the idea that data should remain in plaintext for easy access, real‑world cryptography balances confidentiality, integrity, and availability while using keys to control who can read or modify the information.
- Confidentiality: Ensuring only authorized parties can read the data.
- Integrity: Detecting any alteration of the data.
- Authentication: Verifying the identity of the communicating parties.
Symmetric Key Cryptography
In symmetric cryptography, the same secret key is used for both encryption and decryption. This relationship makes key management crucial because every participant must securely share the identical key before communication can begin.
Key points:
- Both operations use the same secret key.
- Algorithms such as AES, DES, and Blowfish belong to this family.
- Performance is typically faster than asymmetric schemes, making symmetric ciphers ideal for bulk data encryption.
Classic Example: Caesar Cipher
The Caesar cipher is a simple substitution technique that shifts each letter forward by a fixed number of positions. Although it is insecure by modern standards, it serves as an excellent teaching tool for understanding basic encryption concepts.
Example Problem
Given a shift key of 3, encrypt the plaintext "HELLO".
Solution: Shift each letter three places forward in the alphabet:
- H → K
- E → H
- L → O
- L → O
- O → R
The resulting ciphertext is KHOOR.
Key Takeaways
- A Caesar cipher moves every letter forward by the same number of places in the alphabet.
- With a shift of 3, each letter becomes the one three positions later (A→D, B→E, …, X→A, Y→B, Z→C).
- Apply the shift to each letter of "HELLO": H→K, E→H, L→O, L→O, O→R, giving "KHOOR".
- "KHOOR" matches answer choice 4, confirming it as the correct ciphertext.
How to Remember
- Mnemonic: “Shift 3, see the Key – H + 3 = K, E + 3 = H, L + 3 = O, O + 3 = R.”
- Tip: Visualize the alphabet as a circular dial; moving three ticks forward from each letter lands you on the cipher letter.
Attack Techniques
Understanding how attackers try to break cryptographic systems helps you design stronger defenses. Two common attack models are highlighted below.
Known‑Plaintext Attack
A known‑plaintext attack (KPA) relies on the attacker having access to both the original plaintext and its corresponding ciphertext. By analyzing these pairs, the attacker attempts to deduce the secret key or uncover patterns in the encryption algorithm.
Key Takeaways
- A known‑plaintext attack uses pairs of original data (plaintext) and its encrypted form (ciphertext).
- The attacker leverages these pairs to deduce the encryption key or algorithm.
- This differs from chosen‑plaintext attacks (where the attacker selects the plaintext) and from attacks that rely only on ciphertext (e.g., frequency analysis).
How to Remember
- Mnemonic: Known‑plaintext → Know Pair (Plaintext‑Ciphertext pair).
- Tip: Think of a detective who already has a "known" clue (the plaintext) and its "coded" version (the ciphertext) to crack the secret.
Frequency Analysis
Frequency analysis is a classic cryptanalytic technique used primarily against substitution ciphers. By comparing the frequency of letters in the ciphertext to typical language statistics, an analyst can infer likely mappings between ciphertext symbols and plaintext letters.
Key Takeaways
- It identifies patterns in ciphertext by comparing letter frequencies to typical language statistics.
- Effective against simple substitution ciphers where each plaintext letter is consistently replaced by a ciphertext symbol.
- Modern algorithms mitigate this risk by using complex transformations and large key spaces.
Security Notions
Cryptographic security can be classified into two main categories: unconditional (information‑theoretic) security and computational security.
One‑Time Pad (OTP)
The One‑Time Pad is the only proven unconditionally secure cipher. Its security stems from the fact that the ciphertext reveals no information about the plaintext when the key is truly random, as long as the key is as long as the message and used only once.
Why OTP is Unconditionally Secure
- The key is random and never reused.
- Each bit of the plaintext is combined with a random bit via XOR, producing a ciphertext that is statistically independent of the original message.
- Even an adversary with unlimited computational power cannot distinguish the ciphertext from random noise.
Computational Security
A computationally secure cryptosystem is one that cannot be broken in practice with current technology, although it may be theoretically breakable given infinite resources. Security relies on the difficulty of certain mathematical problems (e.g., factoring large integers or solving discrete logarithms).
- Examples include RSA, Diffie‑Hellman, and modern elliptic‑curve schemes.
- Security margins are expressed in key lengths (e.g., 2048‑bit RSA is considered safe today).
- Advances in quantum computing could shift these margins, prompting the study of post‑quantum cryptography.
Brute‑Force Attacks and Key Space
Brute‑force attacks systematically try every possible key until the correct one is found. The feasibility of such attacks depends on the size of the key space.
For a symmetric cipher with a 128‑bit key, the worst‑case scenario requires testing 2^128 possible keys. This astronomical number (≈3.4×10^38) makes exhaustive search impractical with today’s computing capabilities.
Key considerations:
- Increasing key length exponentially expands the key space.
- Hardware advances (GPU, ASIC) can accelerate brute‑force attempts, but the growth in key size typically outpaces these gains.
- Proper key management and algorithm selection are essential to avoid weak configurations that reduce the effective key space.
Putting It All Together: A Study Checklist
- Understand the three pillars of cryptographic security: confidentiality, integrity, and authentication.
- Remember that symmetric encryption uses the same secret key for both encryption and decryption.
- Practice simple ciphers like the Caesar shift to grasp the concept of substitution.
- Know the difference between known‑plaintext, chosen‑plaintext, and ciphertext‑only attacks.
- Recognize why the One‑Time Pad offers unconditional security and why it is rarely used in practice.
- Distinguish computational security from unconditional security and be aware of the underlying hard problems.
- Calculate key space sizes (e.g., 2^128 for a 128‑bit key) to assess resistance against brute‑force attacks.
- Apply frequency analysis concepts when evaluating the strength of substitution‑type ciphers.
By mastering these fundamentals, you’ll be equipped to evaluate cryptographic protocols, recognize potential vulnerabilities, and design more robust security solutions.
