Classical Encryption Techniques
Classical Encryption Techniques
Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 [email protected] Audio/Video recordings of this lecture are available at: http://www.cse.wustl.edu/~jain/cse571-11/
Washington University in St. Louis CSE571S 2011 Raj Jain
2-1
Overview
1. 2. 3. 4. 5.
Symmetric Cipher Model Substitution Techniques Transposition Techniques Product Ciphers Steganography
These slides are based on Lawrie Browns slides supplied with William Stallings book Cryptography and Network Security: Principles and Practice, 5th Ed, 2011.
CSE571S
2-2
Y = E(K, X) X = D(K, Y) K=Secret Key Same key is used for encryption and decryption. Single-key or private key encryption.
Washington University in St. Louis CSE571S 2011 Raj Jain
2-3
2-4
Cryptography Classification
By type of encryption operations used Substitution Transposition Product By number of keys used Single-key or private Two-key or public By the way in which plaintext is processed Block Stream
Washington University in St. Louis CSE571S 2011 Raj Jain
2-5
Cryptanalysis
Objective: To recover key not just message Approaches: Cryptanalytic attack Brute-force attack If either succeed all key use is compromised Brute-force attack:
Key Size (bits) 32 56 128 168 26 characters (permutation) Number of Alternative Keys 232 = 4.3 109 256 = 7.2 1016 2128 = 3.4 1038 2168 = 3.7 1050 26! = 4 1026 Time required at 1 decryption/s 231 s 255 s 2127 s 2167 s 2 1026 s CSE571S = 35.8 minutes = 1142 years = 5.4 1024 years = 5.9 1036 years = 6.4 1012 years Time required at 106 decryptions/s 2.15 milliseconds 10.01 hours 5.4 1018 years 5.9 1030 years 6.4 106 years 2011 Raj Jain
2-6
Substitution
Caesar Cipher: Replaces each letter by 3rd letter on Example: meet me after the toga party PHHW PH DIWHU WKH WRJD SDUWB Can define transformation as:
a b c d e f g h i j k l m n o p q r s t u v w x y z D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
Then have Caesar cipher as: c = E(k, p) = (p + k) mod (26) p = D(k, c) = (c k) mod (26) Weakness: Total 26 keys
Washington University in St. Louis CSE571S 2011 Raj Jain
2-7
CSE571S
2-8
CSE571S
2-9
CSE571S
2-10
One-Time Pad
If a truly random key as long as the message is used, the cipher will be secure Called a One-Time pad Is unbreakable since ciphertext bears no statistical relationship to the plaintext Since for any plaintext & any ciphertext there exists a key mapping one to other Can only use the key once though Problems in generation & safe distribution of key
CSE571S
2-11
2-12
Product Ciphers
Use several ciphers in succession to make harder, but: Two substitutions make a more complex substitution Two transpositions make more complex transposition But a substitution followed by a transposition makes a new much harder cipher This is a bridge from classical to modern ciphers
CSE571S
2-13
Rotor Machines
Before modern ciphers, rotor machines were most common complex ciphers in use Widely used in WW2 German Enigma, Allied Hagelin, Japanese Purple Implemented a very complex, varying substitution cipher Used a series of cylinders, each giving one substitution, which rotated and changed after each letter was encrypted Hagelin Rotor Machine
Washington University in St. Louis CSE571S 2011 Raj Jain
2-14
A becomes Y (First rotor). Y becomes R (2nd rotor). R becomes B (3rd rotor). After each letter, first rotor moves 1 position. After each full rotation of 1st rotor, 2nd rotor moves by 1 position. Cycle length = 263
Washington University in St. Louis CSE571S 2011 Raj Jain
2-15
Steganography
Hide characters in a text, hide bits in a photograph Least significant bit (lsb) of a digital photograph may be a message. Drawback: high overhead to hide relatively few info bits Advantage: Can obscure encryption use
Ref: http://www.cse.wustl.edu/~jain/cse571-09/ftp/stegano/index.html
Washington University in St. Louis CSE571S 2011 Raj Jain
2-16
Summary
1. 2. 3.
4. 5.
The key methods for cryptography are: Substitution and transposition Letter frequency can be used to break substitution Substitution can be extended to multiple letters and multiple ciphers. Mono-alphabetic=1 cipher, Poly-alphabetic=multiple ciphers Examples: Caesar cipher (1 letter substitution), Playfair (2letter), Hill (multiple letters), Vigenere (poly-alphabetic). Multiple stages of substitution and transposition can be used to form strong ciphers.
CSE571S 2011 Raj Jain
2-17
Homework 2
Submit solution to problem 2.18 2.8 This problem explores the use of a one-time pad version of the Vigenere cipher. In this scheme, the key is a stream of random numbers between 0 and 26. For example, if the key is 3 19 5, then the first letter of the plaintext is encrypted with a shift of 3 letters, the second with a shift of 19 letters, the third with a shift of 5 letters, and so on. A. Encrypt the plain text sendmoremoney with the key stream 9 0 1 7 23 15 21 14 11 11 2 8 9 B. Using the ciphertext produced in part (a), find a key so that the cipher text decrypts to the plain text cashnotneeded.
CSE571S
2-18