crypto1

Course content of CS3314 Cryptography

Lecture 2: Fundamentals of Classical Cryptography (Basics of Cryptography)

1. The Overall Framework of Cryptography

The components of cryptology

  • Cryptography: the techniques for designing encryption and protecting information
  • Cryptanalysis: the techniques for breaking ciphers
  • Cryptology = Cryptography + Cryptanalysis

The five-tuple of a cryptosystem

A cryptosystem consists of five sets
(P, C, K, E, D)

  • P: plaintext space (Plaintext)
  • C: ciphertext space (Ciphertext)
  • K: key space (Key)
  • E: encryption algorithm (Encryption)
  • D: decryption algorithm (Decryption)

Satisfying:

D(E(M, K₁), K₂) = M


2. The Two Major Cryptosystems

SystemKey relationshipCharacteristicsExamples
Single-key (symmetric) cryptographyK₁ = K₂Same key for encryption and decryption; fast; key distribution is difficultAES, DES
Two-key (asymmetric) cryptographyK₁ ≠ K₂Different keys for encryption and decryption; the public key can be publishedRSA, ECC

⚠️ Kerckhoffs’s principle:
The security of a cryptosystem should depend only on the secrecy of the key, not on the secrecy of the algorithm.


3. Cryptanalysis and Attack Models

Attack typeWhat the attacker knowsCharacteristics
Ciphertext-onlyOnly ciphertextThe hardest
Known-plaintextSome plaintext-ciphertext pairsCommon against symmetric ciphers
Chosen-plaintextCan choose inputs to be encryptedTypical attack on RSA and the like
Chosen-ciphertextCan choose ciphertexts to be decryptedTargets public-key systems

Attacker capability ranking: ciphertext-only < known-plaintext < chosen-plaintext < chosen-ciphertext


4. Information Theory and the Foundations of Security

Shannon’s contributions

  • Proposed the principles of diffusion and confusion
  • Established the mathematical foundations of cryptography
  • Proved that the One-Time Pad provides perfect secrecy

Classes of security

TypeDefinitionCharacteristics
Unconditional security / perfect secrecy (Unconditional Security)Cannot be broken no matter how much computing power is availablee.g. the one-time pad (OTP)
Computational security (Computational Security)Breaking it costs too much or takes too longe.g. AES, RSA

Condition: if I(M; C) = 0 → perfect secrecy
Necessary condition: H(K) ≥ H(M) → the entropy of the key is at least the entropy of the message (equivalently, key space ≥ plaintext space)


5. Classical Cipher Techniques

1️⃣ Substitution Cipher

Replace plaintext characters with other symbols

TypeEncryption ruleCharacteristics / weaknesses
Caesar shift cipherc = (p + k) mod 26Key space of 25; easily brute-forced
Monoalphabetic substitutionArbitrary permutation tableBreakable by frequency analysis
Affine cipherE(x)=ax+b (mod 26), requires gcd(a,26)=1Easily broken by statistical attacks
Playfair cipherEncrypts pairs of letters (digraphs)Frequency patterns are weakened but it can still be broken
Hill cipherLinear substitution on vectors, Kp=CResists ciphertext-only attacks, but not known-plaintext-pair attacks
Vigenère cipherPolyalphabetic substitution with period rBreakable with the Kasiski method
One-time pad (OTP)cᵢ = mᵢ ⊕ kᵢThe only unconditionally secure system, but key management is difficult

2️⃣ Transposition Cipher

The characters are unchanged; only their order changes.

TypeMethodCharacteristics
Rail FenceWrite diagonally, read row by rowSimple, easily broken
Columnar TranspositionWrite into a matrix, then read the columns in key orderLetter frequencies are unchanged
Product CipherCombination of substitution + transpositionThe bridge from classical to modern

6. Mechanical Ciphers and the Evolution to Modern Cryptography

Rotor Machine

  • Based on polyalphabetic substitution; physical rotors produce different mappings.
  • Representatives: the German Enigma and the Japanese Purple.
  • Lesson: multiple layers of substitution + dynamic permutation → the precursor of the Feistel structure / DES.

7. Steganography

  • Hides the existence of the message; it is not encryption.
  • Examples: invisible ink, image LSB, IoT SmartConfig.
  • Drawbacks: low capacity, easy to detect.

8. Key Takeaways

  1. Security depends on the key, not on the algorithm.
  2. Substitution or transposition alone is not secure; they must be combined.
  3. The key space must be large enough to defend against brute-force attacks.
  4. The OTP is the only unconditionally secure system.
  5. The prototypes of modern cipher algorithms: product ciphers and rotor machines.

Translated from the Chinese original.

中文