Skip to main content

Cryptanalysis Support Program

'; for (m = 1; m <= 26; m++) { outstring += ''+pfreq[n][m]+''; } outstring += ''; outstring += 'Total letters: '+pertotltr[n]+'
IC: '+phiperi[n] + '
'; avgs += phiperi[n]; } outstring = '
Average IC for period length of ' + period + ': ' + (avgs/period) + '
' + outstring; document.getElementById('periodic_ic').innerHTML = outstring; /* for (m = 1; m <= period; m++) { if (pmixfreq[m] === undefined) { pmixfreq[m] = new Array(); } for (n = 1; n <= 26; n++) { pmixfreq[m][n] = pfreq[m][ } }*/ } function do_frequency_count(ct) { var fq = []; var max = false; for (item in ct) { if (fq[ct[item]] < 0 || isNaN(fq[ct[item]])) { fq[ct[item]] = 0; } fq[ct[item]]++; } for (item in fq) { if (max === false) { max = fq[item]; } else { if (max < fq[item]) { max = fq[item]; } } } var letterlist = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var graphstring = '
'; for (var q = 0; q < letterlist.length; q++) { if (fq[letterlist.charAt(q)] === undefined) { fq[letterlist.charAt(q)] = 0; } var myh = (fq[letterlist.charAt(q)] * 200) / max; var mym = 200 - myh; graphstring += '
'; graphstring += letterlist.charAt(q) + "
" + fq[letterlist.charAt(q)]; graphstring += '
'; } graphstring += '
'; document.getElementById("freq-chart").innerHTML = graphstring; } function array_unique(myarr) { var newarr = []; for (var a = 0; a < myarr.length; a++) { for (var b = a + 1; b < myarr.length; b++) { if (myarr[a] === myarr[b]) { b = ++a; } } newarr.push(myarr[a]); } return newarr; }

The following set of cryptanalytic tools is based on the GW BASIC code in appendix F of this declassified Basic Cryptanalysis field manual.

Ciphertext:


Monographic IC:

Digraphic IC:

Length of text:

For frequency analysis, please use the improved frequency analysis tool.

The above ciphertext with repeated sequences underlined.


Periodic Index of Coincidence for a period length of (change for different period)

If the average periodic IC is high, then the chosen period length is likely to be correct, or a multiple of the correct period length. This analysis is helpful for determining the keyword length if a periodic key encryption system like Vigenere Cipher is in use.

Monographic Index of Coincidence - a measure of the likelihood that this ciphertext is a letter-for-letter substitution.


Digraphic Index of Coincidence - a measure of the likelihood that this ciphertext uses two letters to represent one plaintext character.


Get help with games!