Copyright 2009 by Alexander Stanoyevitch, All Rights Reserved

Chapter 5: The Evolution of Codebreaking Until the Computer Era

Index:

5.1: Frequency Counts

5.2: Adjacent Letter Counts

5.3 Ciphertext Partial Substitutions

5.4 Modular Frequency Counts

5.5 Extracting n-gram Data

5.6 Horizontal Shifted Match Counts

5.7 Horizontially Shifted Dot Products


5.1: Frequency Counts

For an inputted upper-case ciphertext, this program gives the observed frequencies of the of the appearances of the 26 letters A, B, C, ... (in order).  Please note that spaces are ignored.

Usage:

To determine the frequencies of the 26 letters in a ciphertext, enter the ciphertext and press Enter.

Ex:

Ciphertext: 

AHFB GXVUD PW P AXJ TKHYU XM WTU YHMBXYYUD YPMWP FGPNP VPGGUE OHDJU ZXGGUNY IGPFU XW LPY FPGGUD XW YWKKD APFB
QNKZ WTU NKPD TPGQ TXDDUM PZKMJ WTU WNUUY WTNKHJT LTXFT JGXZIYUY FKHGD AU FPHJTW KQ WTU LXDU FKKG VUNPMDP WTPW
NPM PNKHMD XWY QKHN YXDUY WTU TKHYU LPY PIINKPFTUD AE JNPVUGGUD DNXVULPEY LTXFT LKHMD PAKHW WTNKHJT LXDUYINUPDXMJ
GPLMY PMD HMDUN WTU XMWUNGPFXMJ AKHJTY KQ WPGG IKIGPNY PW WTU NUPN WTXMJY LUNU KM UVUM P ZKNU YIPFXKHY YFPGU WTPM
PW WTU QNKMW WTUNU LUNU JNUPW YWPAGUY LTUNU P DKRUM JNKKZY PMD AKEY TUGD QKNWT NKLY KQ VXMUFGPD YUNVPMWY FKWWPJUY
PM UMDGUYY PMD KNDUNGE PNNPE KQ KHWTKHYUY GKMJ JNPIU PNAKNY JNUUM IPYWHNUY KNFTPNDY PMD AUNNE IPWFTUY WTUM WTUNU
LPY WTU IHZIXMJ IGPMW QKN WTU PNWUYXPM LUGG PMD WTU AXJ FUZUMW WPMB LTUNU OHDJU ZXGGUNY AKEY WKKB WTUXN ZKNMXMJ
IGHMJU PMD BUIW FKKG XM WTU TKW PQWUNMKKM

Top

5.2: Adjacent Letter Counts

For an inputted upper-case ciphertext, this gives two length 26 vectors: Pre and Post, which give, for the ciphertext letter corresponding to k (0 = A, 1 = B, ... 25 = Z), the number of times each of the 26 letters occurs directly before and directly after the letter corresponding to k in a word.

Usage:

To determine the adjacent letter counts in a ciphertext with spaces, enter the ciphertext, and the numerical value of a letter, k, and press Enter.
Ex: 
Ciphertext: 
AHFB GXVUD PW P AXJ TKHYU XM WTU YHMBXYYUD YPMWP FGPNP VPGGUE OHDJU ZXGGUNY IGPFU XW LPY FPGGUD XW YWKKD APFB
QNKZ WTU NKPD TPGQ TXDDUM PZKMJ WTU WNUUY WTNKHJT LTXFT JGXZIYUY FKHGD AU FPHJTW KQ WTU LXDU FKKG VUNPMDP WTPW
NPM PNKHMD XWY QKHN YXDUY WTU TKHYU LPY PIINKPFTUD AE JNPVUGGUD DNXVULPEY LTXFT LKHMD PAKHW WTNKHJT LXDUYINUPDXMJ
GPLMY PMD HMDUN WTU XMWUNGPFXMJ AKHJTY KQ WPGG IKIGPNY PW WTU NUPN WTXMJY LUNU KM UVUM P ZKNU YIPFXKHY YFPGU WTPM
PW WTU QNKMW WTUNU LUNU JNUPW YWPAGUY LTUNU P DKRUM JNKKZY PMD AKEY TUGD QKNWT NKLY KQ VXMUFGPD YUNVPMWY FKWWPJUY
PM UMDGUYY PMD KNDUNGE PNNPE KQ KHWTKHYUY GKMJ JNPIU PNAKNY JNUUM IPYWHNUY KNFTPNDY PMD AUNNE IPWFTUY WTUM WTUNU
LPY WTU IHZIXMJ IGPMW QKN WTU PNWUYXPM LUGG PMD WTU AXJ FUZUMW WPMB LTUNU OHDJU ZXGGUNY AKEY WKKB WTUXN ZKNMXMJ
IGHMJU PMD BUIW FKKG XM WTU TKW PQWUNMKKM

k: 11

Top


5.3 Ciphertext Partial Substitutions

This program allows the user to enter a ciphertext and guesses at substitutions in the ciphertext, and see the results of their guesses.  Note that spaces within ciphertexts are preserved.

Usage:

Enter a ciphertext, a string of upper case letters, and a string of lower case substitution letters and press Enter.
Ex: 
Ciphertext:
AHFB GXVUD PW P AXJ TKHYU XM WTU YHMBXYYUD YPMWP FGPNP VPGGUE OHDJU ZXGGUNY IGPFU XW LPY FPGGUD XW YWKKD APFB
QNKZ WTU NKPD TPGQ TXDDUM PZKMJ WTU WNUUY WTNKHJT LTXFT JGXZIYUY FKHGD AU FPHJTW KQ WTU LXDU FKKG VUNPMDP WTPW
NPM PNKHMD XWY QKHN YXDUY WTU TKHYU LPY PIINKPFTUD AE JNPVUGGUD DNXVULPEY LTXFT LKHMD PAKHW WTNKHJT LXDUYINUPDXMJ
GPLMY PMD HMDUN WTU XMWUNGPFXMJ AKHJTY KQ WPGG IKIGPNY PW WTU NUPN WTXMJY LUNU KM UVUM P ZKNU YIPFXKHY YFPGU WTPM
PW WTU QNKMW WTUNU LUNU JNUPW YWPAGUY LTUNU P DKRUM JNKKZY PMD AKEY TUGD QKNWT NKLY KQ VXMUFGPD YUNVPMWY FKWWPJUY
PM UMDGUYY PMD KNDUNGE PNNPE KQ KHWTKHYUY GKMJ JNPIU PNAKNY JNUUM IPYWHNUY KNFTPNDY PMD AUNNE IPWFTUY WTUM WTUNU
LPY WTU IHZIXMJ IGPMW QKN WTU PNWUYXPM LUGG PMD WTU AXJ FUZUMW WPMB LTUNU OHDJU ZXGGUNY AKEY WKKB WTUXN ZKNMXMJ
IGHMJU PMD BUIW FKKG XM WTU TKW PQWUNMKKM
C Letters: KPWTQNMXHJZYDUG
P Letters: oathfrnijgmsdel

Top


5.4 Modular Frequency Counts

For an inputted upper-case ciphertext, this program gives the tallies of the observed frequencies of appearances of the 26 letters A, B, C, ... (in order) in all of the positions of the ciphertext whose places are congruent to i(mod n).  Note that spaces in ciphertexts are ignored.

Usage:

To determine the modular frequencies of a ciphertext, enter a ciphertext, a non-negative integer i and a modulus n, with i < n, and press Enter.
Ex:
 
    Ciphertext:
AHFB GXVUD PW P AXJ TKHYU XM WTU YHMBXYYUD YPMWP FGPNP VPGGUE OHDJU ZXGGUNY IGPFU XW LPY FPGGUD XW YWKKD APFB
QNKZ WTU NKPD TPGQ TXDDUM PZKMJ WTU WNUUY WTNKHJT LTXFT JGXZIYUY FKHGD AU FPHJTW KQ WTU LXDU FKKG VUNPMDP WTPW
NPM PNKHMD XWY QKHN YXDUY WTU TKHYU LPY PIINKPFTUD AE JNPVUGGUD DNXVULPEY LTXFT LKHMD PAKHW WTNKHJT LXDUYINUPDXMJ
GPLMY PMD HMDUN WTU XMWUNGPFXMJ AKHJTY KQ WPGG IKIGPNY PW WTU NUPN WTXMJY LUNU KM UVUM P ZKNU YIPFXKHY YFPGU WTPM
PW WTU QNKMW WTUNU LUNU JNUPW YWPAGUY LTUNU P DKRUM JNKKZY PMD AKEY TUGD QKNWT NKLY KQ VXMUFGPD YUNVPMWY FKWWPJUY
PM UMDGUYY PMD KNDUNGE PNNPE KQ KHWTKHYUY GKMJ JNPIU PNAKNY JNUUM IPYWHNUY KNFTPNDY PMD AUNNE IPWFTUY WTUM WTUNU
LPY WTU IHZIXMJ IGPMW QKN WTU PNWUYXPM LUGG PMD WTU AXJ FUZUMW WPMB LTUNU OHDJU ZXGGUNY AKEY WKKB WTUXN ZKNMXMJ
IGHMJU PMD BUIW FKKG XM WTU TKW PQWUNMKKM

i: 2
n: 3

Top

5.5 Extracting n-gram Data

Given a ciphertext and a gram length, n, this gives the repeated ciphergrams of length n, the location of their first occurrence, the number of duplications for the ciphergram, and the GCD of the separation distances between occurrences.

Usage:

Ex: 
    Ciphertext: PDYTHXYNAWHMITHLLMGCIFHEWZPULSPEOICCLVNQZTHZPGZHVVDLHWPNEBXGPXYMCZPHTPGZHVVDTMGCIXOVVHXUEZTCNASRCUYHECUGQTOUGRGPUKSSLH
WDAFHZSSWCDSPYUGWBLFTGTLWAKPGYVOBPUGRHSYKCHPZHFXEMASHPYFSSWCDSPSIKGTXUDWCRUMOUPHVSDFNKOVPINGAJBBUWEBXAPYHXFDQBXFHNLTAQ
WYHJTCNASHPQTZADIYKPEYKWHLGRGITWMVXYATBSXIKSDGYKOIEBXHDAIYHWPGPSGPIKRXYUKWAJNASHPJKCQWYFGXYQAWIPQTHTCNASUZUFFPNCGUSZQG
TGZGMVTDOFAXEIYSPNBPOKPLXEJTLBBVLHXKAPUIOCOUESPAZKCBEBXOXC
    n: 4

Top


5.6 Horizontally Shifted Match Counts

Given a string of ciphertext and a shift parameter, i, this gives the number of exact matches when two copies of the ciphertext are written out, the first on top of the second, with the second copy shifted horizontally i characters to the right.

Usage:

Ex: 
    Ciphertext:
PDYTHXYNAWHMITHLLMGCIFHEWZPULSPEOICCLVNQZTHZPGZHVVDLHWPNEBXGPXYMCZPHTPGZHVVDTMGCIXOVVHXUEZTCNASRCUYHECUGQTOUGRGPUKSSLH
WDAFHZSSWCDSPYUGWBLFTGTLWAKPGYVOBPUGRHSYKCHPZHFXEMASHPYFSSWCDSPSIKGTXUDWCRUMOUPHVSDFNKOVPINGAJBBUWEBXAPYHXFDQBXFHNLTAQ
WYHJTCNASHPQTZADIYKPEYKWHLGRGITWMVXYATBSXIKSDGYKOIEBXHDAIYHWPGPSGPIKRXYUKWAJNASHPJKCQWYFGXYQAWIPQTHTCNASUZUFFPNCGUSZQG
TGZGMVTDOFAXEIYSPNBPOKPLXEJTLBBVLHXKAPUIOCOUESPAZKCBEBXOXC

    i: 5

Top


5.7 Horizontially Shifted Dot Products

Given a length 26 character frequency vector F for a ciphertext passage (which could be obtained using applet 5.1), this determines the dot products of F with each of the shifted vectors V0, V1, ..., V25, where V0 gives the frequencies of the English Alphabet, and Vi is obtained by shifting i characters to the right.

Usage:

Ex: 
     Frequency Vector: 0.060 0.036 0.036 0.072 0.012 0 0.060 0.108 0.060 0.012 0.012 0.012 0 0.012 0 0.133 0.024 0.012 0.060 0.084 0.024 0.024 0.024 0.084 0 0.036

Top