Algorithm Details for: Find Relative Shifts between Key Letters

  1. Split text into rows of the same length as the key.
  2. For each column, determine the frequencies of each letter.
  3. Find all MI(c) of each column with every other column.
  4. Search for the MI(c)'s closest to .065, this yields the relative shift from col i to col j.
  5. Form a system of equations and solve in terms of one keyletter.
  6. The keyword is a cyclic shift of the result.


The MI(c) is represented by the following equation:


Where n and m are the lengths of substrings f and h, f sub i is the frequency of letter i, and h sub i - g is the frequency of letter i - g where 0 <= g <= 25.


Alogorithm taken from Stinson pgs 33 - 36 (see sources page).