Title: Chap' 2 Classical Encryption Techniques
1Chap. 2 Classical Encryption Techniques
2Cryptography
Introduction to Cryptography
- Cryptography is the study of secret (crypto-)
writing (-graphy) - Concerned with developing algorithms which may be
used to - Conceal the context of some message from all
except the sender and recipient (privacy or
secrecy), and/or - Verify the correctness of a message to the
recipient (authentication or integrity) - Basis of many technological solutions to computer
and communications security problems
3Basic Terminology
Introduction to Cryptography
- Cryptography
- The art or science encompassing the principles
and methods of transforming message an
intelligible into one that is unintelligible, and
then retransforming that message back to its
original form - Plaintext
- The original intelligible message
- Ciphertext
- The transformed message
- Cipher
- An algorithm for transforming an intelligible
message into one that is unintelligible by
transposition and/or substitution methods - Key
- Some critical information used by the cipher,
known only to the sender receiver
4Introduction to Cryptography
Basic Terminology - 2
- Encipher (encode)
- Process of converting plaintext to ciphertext
using a cipher and a key - Decipher (decode)
- The process of converting ciphertext back into
plaintext using a cipher and a key - Cryptanalysis (codebreaking)
- The study of principles and methods of
transforming an unintelligible message back into
an intelligible message without knowledge of the
key. - Cryptology
- The field encompassing both cryptography and
cryptanalysis
5Introduction to Cryptography
Basic Terminology - 3
- Encryption
- The mathematical function mapping plaintext to
ciphertext using the specified key Y EK(X)
or E(K, X) - Decryption
- The mathematical function mapping ciphertext to
plaintext using the specified key X DK(Y)
or D(K, X) EK-1(Y)
6Introduction to Cryptography
Basic Terminology - 4
- Cryptographic system (Cryptosystem)
- A cryptosystem is a five-tuple (P, C, K, E, D),
where following conditions are satisfied - P is a finite set of possible plaintexts
- C is a finite set of possible ciphertexts
- K, the keyspace, is a finite set of possible keys
- For each K ? K, there is an encryption algorithm
EK ? E and a corresponding decryption algorithm
DK ? D. Each EK P ? C and DK C ? P are
functions such that DK(EK(X)) X for every
plaintext X ? P.
7Simplified Conventional Encryption Model
Conventional Encryption Model
- Requirements
- Strong encryption algorithm
- Share of the secret key in a secure fashion
- Conventional
- Secret-Key (? Public-Key)
- Single-Key (? Two-Key)
- Symmetric (? Asymmetric)
Kerchhoffs Principle Encryption algorithms
being used should be assumed to be publicly known
and the security of the algorithm should reside
only in the key chosen
8Conventional Cryptosystem Model
Conventional Encryption Model
9Cryptanalysis
Conventional Encryption Model
- Process of attempting to discover X or K or both.
- Various types of cryptanalytic attacks
Probable-word attack
Differential cryptanalysis
10Exhaustive Key Search
Conventional Encryption Model
- Brute-force attack
- Always theoretically possible to simply try every
key - Most basic attack, directly proportional to key
size - Assume either know or can recognize when
plaintext is found - Average Time Required for Exhaustive Key Search
11Unconditional and Computational Security
Conventional Encryption Model
- Unconditionally secure (Perfect secure)
- No matter how much computer power is available,
the cipher cannot be broken since the ciphertext
provides insufficient information to uniquely
determine the corresponding plaintext - Computationally secure
- The cost of breaking the security exceeds the
value of the secured service or information. - The time required to break the security exceeds
the useful lifetime of the information
12Classical Encryption Techniques
Classical Encryption Techniques
- Substitution Techniques
- Caesar Cipher
- Monoalphabetic Ciphers
- Playfair Cipher
- Hill Cipher
- Polyalphabetic Ciphers
- One-Time Pad
- Transposition (Permutation) Techniques
- Rail Fence Technique
- Block (Columnar) Transposition Technique
- Product Techniques
- Substitution and transposition ciphers are
concatenated
13Caesar Cipher
Substitution Techniques
- 2000 years ago, by Julius Caesar
- A simple substitution cipher, known as Caesar
cipher - Replace each letter with the letter standing 3
places further down the alphabet - Plain meet me after the toga party
- Cipher PHHW PH DIWHU WKH WRJD SDUWB
- No key, just one mapping (translation)
- 0123456...
- Plain abcdefghijklmnopqrstuvwxyz
- Cipher DEFGHIJKLMNOPQRSTUVWXYZABC
- 3456789...
- ciE(3,pi)(pi3) mod 26
- piD(3,ci)(ci-3) mod 26
14Generalized Caesar Cipher
Substitution Techniques
- Can use any shift from 1 to 25, i.e., replace
each letter by a letter a fixed distance away - ciE(k,pi)(pik) mod 26
- piD(k,ci)(ci-k) mod 26
- Shift cipher
- Key k
- Key letter the letter a plaintext A maps to
- e.g. a key letter of F means A maps to F, B to G,
, Y to D, Z to E - Hence have 26 (25 useful) ciphers
- Key space 26
15Substitution Techniques
Brute-Force Cryptanalysis of Caesar Cipher
- Ciphertext only attack
- Charateristics for success
- The encryption and decryption algorithms are
known - There are only 25 keys to try
- The language of the plaintext is known and easily
recongnizable
16Affine Cipher
Substitution Techniques
- ciE(k,pi)(k1pik2) mod 26 gcd(k1,26)1
- piD(k,ci)(k1-1(ci-k2)) mod 26
- Key k (k1,k2)
- Number of keys ?(26) x 26 12 x 26 312
- ?(m) the number of integers in Zm that are
relatively prime to m - k1?1,3,5,7,9,11,15,17,19,21,23,25
- Caesar/Shift ciphers are special cases of affine
ciphers
17Monoalphabetic Substitution Ciphers
Substitution Techniques
- Further generalization of the Caesar cipher,
- Plain abcdefghijklmnopqrstuvwxyz
- Cipher DEFGHIJKLMNOPQRSTUVWXYZABC
- is obtained by allowing any permutation of 26
characters for the cipher - Key size 26
- Key space 26! ? 4x1026
- Unique mapping of plaintext alphabet to
ciphertext alphabet ? Monoalphabetic - For a long time thought secure, but easily
breakable by frequency analysis attack
18Relative Frequency of Letters in English Text
Substitution Techniques
19Frequency Statistics of Language
Substitution Techniques
- In addition to the frequency info of single
letters, the frequency info of two-letter
(digram) or three-letter (trigram) combinations
can be used for the cryptanalysis - Most frequent digrams
- TH, HE, IN, ER, AN, RE, ED, ON, ES, ST, EN, AT,
TO, NT, HA, ND, OU, EA, NG, AS, OR, TI, IS, ET,
IT, AR, TE, SE, HI, OF - Most frequent trigrams
- THE, ING, AND, HER, ERE, ENT, THA, NTH, WAS, ETH,
FOR, DTH
20Homophones
Substitution Techniques
- Monoalphabetic substitution ciphers are easy to
break through letter frequency analysis - Multiple substitutes (homophones) for a single
letter can be used to hide the single-letter
frequency information - But even with homophones, multiple-letter
patterns (e.g. digram frequencies) still survive
in the ciphertext - Two approaches for this problem
- Encrypt multiple letters of plaintext
- Playfair cipher
- Hill cipher
- Use multiple cipher alphabets
- Polyalphabetic cipher
21Playfair Cipher
Substitution Techniques
- Best-known multiple-letter substitution cipher
- Digram cipher (digram to digram, i.e., E(pipi1)
cici1 through keyword-based 5x5 transformation
table) -
- Great advance over simple monoalphabetic
cipher (26 letters ? 26x26676 digrams) - Still leaves much of the structure of the
plaintext language ? relatively easy to break - Can be generalized to polygram cipher
Keyword monarchy Plaintext H S E A A R M
U Ciphertext B P I M R M C M
22Substitution Techniques
Relative Frequency of Occurrence of Letters
23Hill Cipher
Substitution Techniques
- Multi-letter cipher
- Takes m successive plaintext letters and
substitutes for them m ciphertext letters - 3x3 Hill cipher
- K
- C EK(P) KP P DK(C) K-1C K-1KP P
- m x m Hill cipher hides (m-1)-letter frequency
info - Strong against for the ciphertext-only attack,
but easily broken with known plaintext attack - with m plaintext-ciphertext pairs, each of length
m K CP-1
c1 (k11p1 k12p2 k13p3) mod 26 c2 (k21p1
k22p2 k23p3) mod 26 c3 (k31p1 k32p2
k33p3) mod 26
k11 k12 k13 k21 k22 k23 k31 k32 k33
24Polyalphabetic Cipher
Substitution Techniques
- Typically a set of monoalphabetic substitution
rules is used - Key determines which rule to use
25Vigenère cipher
Substitution Techniques
- Best-known polyalphabetic ciphers
- Each key letter determines one of 26 Caesar
(shift) ciphers - ci E(pi) pi ki mod(key length) mod 26
- Example
- Keyword is repeated to make a key as long as the
plaintext - (Kasiski Test) Given a sufficient amount of
ciphertext, common sequences are repeated,
exposing the period (keyword length) ? Target of
the cryptanalysis
Key deceptivedeceptivedeceptive Plaintext weare
discoveredsaveyourself Cipheretxt ZICVTWQNGRZGVTW
AVZHCQYGLMGJ
26Substitution Techniques
Vigenère cipher - 2
27Vigenère cipher - 3
Substitution Techniques
- If the keyword length is N, then Vigenère cipher,
in effect, consists of N monoalphabetic
substitution ciphers ?
Consider each of the ciphers separately - Improvement over the Playfair cipher, but
language structure and frequency information
still remain - Vigenère autokey system after key is exhausted,
use plaintext for running key (to eliminate the
periodic nature) - Key and plaintext share the same frequency
distribution of letters ? a statistical technique
can be used for the cryptanalysis, (e.g., e
enciphered with e would occur with a frequency of
(0.1275)2 ? 0.0163, t enciphered with t would
occur with a frequency of (0.0925)2 ? 0.0086,
etc.)
Key deceptivewearediscoveredsav Plaintext weare
discoveredsaveyourself Cipheretxt ZICVTWQNGKZEIIG
ASXSTSLVVWLA
28One-Time Pad
Substitution Techniques
- Perfect substitution cipher
- Improved Vernam cipher
- Use a random key (pad) which is as long as the
message, with no repetitions. - Key distribution is a problem
- Or, random key stream generation is a problem
- With such key, plaintext and ciphertext are
statistically independent - Unconditionally secure (Unbreakable)
29Transposition (Permutation) Techniques
Transposition Techniques
- Hide the message by rearranging the letter order
without altering the actual letters used - Rail Fence Cipher
- Write message on alternate rows, and read off
cipher row by row - Example
- Block (Columnar) Transposition Ciphers
- Message is written in rectangle, row by row, but
read off column by column The order of columns
read off is the key - Example
- Generalization multiple transpositions ? More
secure
Key 4 3 1 2 5 6 7 Plaintext a t t a c k p o
s t p o n e d u n t i l t w o a m x y
z Ciphertext TTNAAPTMTSUOAODWCOIXKNLYPETZ
30Rotor Machines
Rotor Machines
- Mechanical cipher machines, extensively used in
WWII Germany (Enigma), Japan (Purple), Sweden
(Hagelin)
- Each rotor corresponds to a substitution cipher
- A one-rotor machine produces a polyalphabetic
cipher with period 26 - Output of each rotor is input to next rotor
- After each symbol, the fast rotor is rotated
- After a full rotation, the adjacent rotor is
rotated (like odometer) - - An n rotor machine produces a polyalphabetic
cipher with period 26n
31Rotor Machines
Three-Rotor Machines
32Steganography
Steganography
- The art of covered writing
- Security by obscurity
- Hide messages in other messages
- Conceal the existence of message
- Conceal what you are communicating (Sending
encrypted messages would make you a spy) -
- Character marking. Overwrite with a pencil
- Invisible ink, - Pin punctures, - First letter
of each word - Letter position on page, - Drawings, - Codes
- Typewriter correction ribbon
- Microdots
- Digital steganography
- Spread spectrum
Covert channel or Subliminal channel
Digital Watermarking
33Steganography
Steganography - Example
News Eight Weather Tonight increasing snow.
Unexpected precipitation Smothers Eastern towns.
Be extremely cautious and use snowtires
especially heading east. The highways are
knowingly slippery. Highway evacuation is
suspected. Police report emergency situations in
downtown ending near Tuesday First letter of
each word yields Newt is upset because he thinks
he is President This example was
created by Neil F. Johnson, and was published in
Steganography,Technical Report TR_95_11_nfj,
1995. URL http//www.jjtc.com/pub/tr_95_11_
nfj/ From WWII German spy (Kahn) Apparently
neutrals protest is thoroughly discounted and
ignored. Isman hard hit. Blockade issue affects
pretext for embargo on by products, ejecting
suets and vegetable Oils. Second letter of
each word yields Pershing sails from NY June 1.
34Steganography
Steganography - Exercise
What is the message embedded in the left figure?
(Prob. 2.1)
35Chapter 2 Homework
- Problems 2.1, 2.4, 2.8, 2.11, 2.14(a), 2.17, 2.19
- Due date 17 March 2006