[Overview] [Commands] [Usage Hints] [References]

JKrypto Help

The jkrypto classical cipher analysis program is used for generating and analysing classical substitution and transposition ciphers.

Overview

When running this program displays a window, most of which is taken with the current data area. There is also a text-field to enter a keyword into, and status messages are displayed in red at the bottom. The menubar provides access to the commands available.

To use this program you load the text you wish to analyse into the main data window, either by typing (or copying and pasting) it in, or by reading it from a file (see File menu). You then need to select the correct type of cipher you wish to use from the list in the Cipher menu. Then this text can be encrypted or decrypted (under Cipher menu) using the specified type of cipher and key, or analysed using the various methods provided in the Analysis menu. The resulting text or analysis results can be saved to a file (see File menu). More details on the commands are given below.

[top]

Commands

The commands available in the GUI version of the jkrypto program are:
File
This menu contains the commands for interacting with files and controlling the progam.
New
clear data and resets the undo history, ready to work with new data.
Open
pops up a dialog letting you select a text file to open and read its contents into the data area.
Save As
pops up a dialog box letting you select a file to save data (or popup window contents) to.
Close
(in popup window) closes popup window.
Quit
the program.
Edit
This menu contains commands for working with the contents of the data area.
Undo
Undo the last change to the data (as of last command).
Copy
Copy selected text in the data area to the system clipboard.
Paste
Paste contents of system clipboard into data.
Reset
Reset the data area to the text last read in from file (or erase if started with new data).
Cipher
This menu contains the commands to encrypt or decrypt the data area, and to specify the type of cipher to use for this.
Encrypt
Encrypt the data using the current cipher type and key. nb. the key format depends on the type of cipher, as noted below.
Decrypt
Decrypt the data using the current cipher type and key.

Vigenere
use a Vigenere substitution cipher, using forward shifted alphabets. The key is a single word, each letter of which specifies the shift for the corresponding alpabet. eg key "spy" specifies the use of 3 alphabets, with 'A' mapped to 'S', 'P', and 'Y' respectively.
Beauford
use a Beauford substitution cipher, using reverse shifted alphabets. The key is a single word, each letter of which specifies the shift for the corresponding alpabet, as for a Vigenere cipher.
General
use a General substitution cipher, using shuffled alphabets. The key is a phrase (ie multiple words), where each word specifies a single shuffled alphabet, generated by writing out the word with remaining letters lined up below, as detailed in the references. eg. key "starwars rules" specifies the use of 2 alphabets, generated using "starwars" for the first and "rules" for the second.
Row
use a Row transposition cipher, where the letters in each row are shuffled in the order specified by the key. The key is either a word or a permutation. If a word, the order of the letters in the alphabet determines the order columns are used. eg key "fred" means that column 4, then 3, then 1 then 2 is used (since 'd' < 'e' < 'f' < 'r'). Alternatively this can be specified directly using the permutation "4,3,1,2" as the key.
Column
use a Column transposition cipher, where the letters in each column are used in the order specified by the key. The key is either a word or a permutation, as for row transpositions.
Analysis
This menu contains the commands to analyse the data area.
Freq
prompts for a number of alphabets and then computes the frequency counts for each letter a-z in the data divided into that many alphabets. The results are displayed in a popup window, which may be saved.
Graph
prompts for a number of alphabets and then graphs the frequency counts for each letter a-z in the data divided into that many alphabets. The results are displayed in a popup window, which may be saved.
Graph Image
prompts for a number of alphabets and then graphs the frequency counts as a bar chart. These charts are displayed in a popup window, and may be saved as a png or jpg file.
IC
prompts for a number of alphabets and then computes the Index of Coincidence on the data divided into that many alphabets. The IC for 1 alphabet is shown in the status area, for multiple a popup window is used.
Kasiski
prompts for a word length to use, and then finds all repeated strings of that length, and displays the strings, and the distances between them. These values can be used to determine the possible number of alphabets used in the data (assuming its a polyalphabetic substitution cipher) using the Kasiski method.
Replace Char
prompts for characters to change and replaces all instances of the first with the second in the data.

Search
prompts for a number of columns (ie permutation size) and a regular expression to match against (which can blank to see all permutations), and then tries all decrypting all possible permutations assuming either a row or column transposition cipher (as specified in the Cipher menu) and checking whether it matches the desired regular expression. The results show the permutations and decryptions for all matches (or every possible decryption of no regular expression is specified). This search can take a considerable amount of time for larger sizes, hence it runs in the background, and pops up a window with the results when done.
Search Status
displays which permutation the current search (if any) is currently up to.
Stop Search
stops the current search (if one is running), displaying any results found to this point.
Reformat Data
prompts for a block size and number of blocks per line, and then reformats the data into blocks as specified. This can be useful for working out which alphabet a letter is in (by reformatting into block sizes matching suspected numebr of alphabets), or for displaying layed out in a suspected number of columns for a transposition.
Help
About JKrypto
displays information and copyright details for this program.
JKrypto Help
displays this help information.

[top]

Usage Hints

Some brief hints about how to go about breaking a classical cipher. You generally need to first determine the type of cipher (substitution or permutation) from the IC and frequency distribution. nb. if a product cipher or other more complex form is being analysed, it will be much harder and be beyond the scope of this program.

If have a substitution (ie not mono-alphabetic IC with English letter pattern) then:

  1. determine how many alphabets were used using the Kasiski method & IC to estimate period d
  2. verify the period by checking that the IC's on d alphabets are all mono-alphabetic
  3. then solve each of the d alphabets as a monoalphabetic cipher using frequency distribution of each, plus common double & triple letters and word boundaries spanning them

If have a transposition (mono-alphabetic IC with English letter pattern) then:

  1. try each type (row, column) in turn
  2. basic idea is to work through possible periods looking for re-arrangements which look "text-like" to find solution
  3. since number of possibilities grows exponentially, need to restrict search using a target string (or better still, a target regular expression. A good start would be the.*the for more options, see references)

[top]

References

For additional information, see:
  • Lawrie Brown's ADFA Cryptography course notes
  • J Pieprzyk, T Hardjono, J Seberry, "Fundamentals of Computer Security", Ch 3, 1/e, Springer-Verlag, 2003.
  • A Sinkov, "Elementary Cryptanalysis", Chs 1,2,3,5, New Mathematical Library, Random House, 1968
  • W Stallings, "Cryptography and Network Security", Ch 2.1-2.3, 5/e, Prentice-Hall, 2010.
  • D Stinson, "Cryptography: Theory and Practice", Ch 1, CRC Press, 1995
  • [top]


    This version of the jkrypto program was written by Lawrie Brown 2002-2010, adapted from the original code by Daryl Bossert. It is Copyright © 2010 by Lawrie Brown.