5-Cryptanalysis Techniques

For large key spaces, brute forcing is possible but not practical

Cryptanalysis is the process of trying to work out the encryption key from a given ciphertext.

  • This type of attack exploits the characteristics of the algorithm to attempt to deduce a specific plaintext or key
  • Attacker will analyze the ciphertext using different statistical tests- they must have prior knowledge of the nature of plaintext (plain English, photo, exe file etc).

Frequency Analysis

This technique is based on the fact that, in any given piece of text, certain letters and combinations of letters occur with varying frequencies. For instance, given a section of English language, letters E, T, A and O are most common while letter Z, Q and X are not as frequently used.
When trying to decrypt a cipher text based on a substitution cipher, we can use frequency analysis to help identify the most recurring letters in the cipher text and hence make hypothesis of what these letters have been encoded as.
For instance, If, in our ciphertext the character with most frequency is Z we can assume that E was encoded as Z because E occurs most frequently in English language.

We can also find frequency of group of letters (di-grams and tri-grams) and map them to commonly occuring group of letters like an, in, the etc.

Guessing the Key Length in Vigenere Cipher

We can guess the key length in Vigenere Cipher by observing the cyphertext for repeated string. The distance between repititions is expected to be a multiple of key length

After key length is guessed, we can use frequency analysis by breaking ciphertext into n sections and doing frequency analysis on each section.

For Example, if ciphertext is AKJDLSJFLFNSKJDBKJAD and key length is 3 we can break ciphertext into 3 sections as AKJ DLS JFL , … , JAD and do frequency analysis on each section

But what happens if the key length is equal or longer than the length of cipher text? This technique fails