Documente Academic
Documente Profesional
Documente Cultură
SUBSTITUTION TECHNIQUES
Key
Exercise 1 - Caesar cipher
• Decrypt the following message using Caesar
cipher
Polygraphic Substitution Ciphers
• Encrypts letters in groups
• Frequency analysis more difficult
Hill Cipher
• Developed by the mathematician Lester Hill in 1929
• Strength is that it completely hides single-letter
frequencies
– The use of a larger matrix hides more frequency information
– A 3 x 3 Hill cipher hides not only single-letter but also two-letter
frequency information
• Strong against a ciphertext-only attack but easily broken
with a known plaintext attack
• Example:
Hill Ciphers
• Polygraphic substitution cipher
• Uses matrices to encrypt and decrypt
• Uses modular arithmetic (Mod 26)
Modular Arithmetic
• For a Mod b, divide a by b and take the
remainder.
• 14 ÷ 10 = 1 R 4
• 14 Mod 10 = 4
• 24 Mod 10 = 4
Modulus Theorem
Modulus Examples
Modular Inverses
• Inverse of 2 is ½ (2 · ½ = 1)
• Matrix Inverse: AA-1= I
• Modular Inverse for Mod m: (a · a-1) Mod m =
1
• For Modular Inverses, a and m must NOT have
any prime factors in common
Modular Inverses of Mod 26
A 1 2 5 7 9 11 15 17 19 21 23 25
A-1 1 9 21 15 3 19 7 23 11 5 17 25
9 · 3 = 27
27 Mod 26 = 1
N O P Q R S T U V W X Y Z
13 14 15 16 17 18 19 20 21 22 23 24 25
Change Message to Vectors
Message to encrypt = HELLOWORLD
Multiply Matrix by Vectors
Convert to Mod 26
Convert Numbers to Letters