CH Conventional Encryption Classical Techs by MikeJenny


									                                         Classical 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
                                               Substitution Techniques

                 Caesar Cipher
• 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
• No key, just one mapping (translation)
   Plain: abcdefghijklmnopqrstuvwxyz
• ci=E(3,pi)=(pi+3) mod 26;
  pi=D(3,ci)=(ci-3) mod 26
                                                 Substitution Techniques

   Generalized Caesar Cipher

• Can use any shift from 1 to 25, i.e., replace each letter
  by a letter a fixed distance away
      ci=E(k,pi)=(pi+k) mod 26;
      pi=D(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
                                                 Substitution Techniques

Monoalphabetic Substitution Ciphers
• Further generalization of the Caesar cipher
• Plain: abcdefghijklmnopqrstuvwxyz
        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
                                    Substitution Techniques

Relative Frequency of Letters in English Text
                                                 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
                                                     Substitution Techniques

Playfair Cipher
 • Best-known multiple-letter substitution cipher
 • Digram cipher (digram to digram, i.e., E(pipi+1) = cici+1
     through keyword-based 5x5 transformation table)
        M   O   N   A   R
                            Keyword = monarchy
        C   H   Y   B   D
                            Plaintext: H S E A A R M U
        E   F   G   I/J K
                            Ciphertext: B P I M R M C M
        L   P   Q   S   T
        U   V   W X     Z

 • Great advance over simple monoalphabetic cipher (26
     letters  26x26=676 digrams)
 •   Still leaves much of the structure of the plaintext language
      relatively easy to break
 •   Can be generalized to polygram cipher
                                 Substitution Techniques

Relative Frequency of Occurrence of Letters
                                                 Substitution Techniques

Polyalphabetic Cipher

 • Typically a set of monoalphabetic substitution rules is used
 • Key determines which rule to use
                                                    Substitution Techniques

Vigenère cipher

 •   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:
                 Key:          deceptivedeceptivedeceptive
                 Plaintext:    wearediscoveredsaveyourself
                 Cipheretxt:   ZICVTWQNGRZGVTWAVZHCQYGLMGJ

 • Keyword is repeated to make a key as long as the
                      Substitution Techniques

Vigenère cipher - 2
                                                   Substitution Techniques

Vigenère cipher - 3
• 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:         deceptivewearediscoveredsav
            Plaintext:    wearediscoveredsaveyourself
                                                 Transposition Techniques

Transposition (Permutation) 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
      – Eg M e m a t r h t g p r y    MEMATRHTGPRYETEFETEOAAT
           e t e f e t e o a a t

 • 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        Key:        4 3 1 2 5 6 7
                   Plaintext: a t t a c k p
                              o s t p o n e
     – Example:               d u n t i l t
                              w o a m x y z

To top