Codes and Ciphers.

Ciphers

Autokey.
Digraph Ciphers
Keyword Substitution.
Keyword Poly.
One Time Pad.
Playfair Cipher.
Poly-Alphabetic Ciphers.
Random Substitution.
Simple Shift.
Solitaire Cipher.
Square Reverser.
Symbol Substitution.
Transposition Ciphers.
Viginere Cipher.

National Cipher Challenge

This years competition starts on Thursday September 27th at 15:30 hrs. The challenges from previous years can be found on the rules page of this year's contest.
Last year one of our teams won £25. It would be really good to have several teams entered again this year. Visit the site and get registered!


Previous Cipher Challenges.

Sections

Frequency Analysis.
Digraph Counter
EXCEL Programming
Tool Box
Useful Links

Section 1. Mono-Alphabetic Substitution Ciphers.

Caesar or Shift Ciphers.

Julius Caesar, the first Roman emporer, is credited with inventing this type of cipher. To create a simple shift cipher all that you need to do is write out the alphabet and then write the alphabet out again, underneath, but shifted to the left or to the right.

An alternative is to use a cipher wheel to acheive the same effect.

Cut both wheels out. Stick one inside the other and turn the inner wheel to generate your cipher.

To encode your message all you need to do is work through your message (the plaintext) and convert it, one letter at a time, into ciphertext.

Decryption is the reverse of the process. You must know how much the alphabet has been shifted by or your message will be gibberish.

Symbol Substitution Ciphers.

These use a set of symbols instead of the latin alphabet. These codes are very easy to use on wordprocessors. First encipher your message using the cipherwheel or the strip of alphabet letters then highlight the text and convert the message into a crazy font.

Keyword Ciphers.

.

These use a keyword to generate the cipher. This is inserted at the start of the alphabet. Be very careful to avoid repeating letters either in the keyword or further on in the cipher alphabet. Messages are encrypted in the same way as before.

Random Alphabet.

These use a random alphabet. They are the hardest of this type of cipher to break. You must remember how you randomised the alphabet.

Liebnitz Ciphers.

Liebnitz Binary Specific adaption for codes in binary letter form, aaab abba baba etc.

Affine Shift Cipher

These use a mapping formula to produce a new alphabet. There are more details on the Affine Shift Cipher page but to break these ciphers treat then as a random single substitution cipher. Use frequency analysis to fine likely candidates for ETAOIN etc and then try to spot words like THE. Gradually work through the ciphertext guessing letters and words.

How to break these ciphers.

You need to understand exactly how the cipher works. Try writing your own messages with the cipher first. Can you guess any of the words or letters in the cipher? Look for single letters or repeated groups of letters. Look for one, two or three letter words. Try guessing but make sure that you know which letters are guesses and which are definite.

JavaScript Substitution Code Tools. Most tools that you will need on one webpage. Written in JavaScript so that you can download the source code and modify it.


The other tool that you need is frequency analysis. This helps you to guess which letter is which in the cipher.

Data graphs and tables. Frequency analysis results for standard English taken from huge samples of literature.


Challenges.

Challenges. Challenges using the 26 letter english alphabet based on the cipher systems described in this section.

Symbol Challenges. Challenges using symbols alphabetsbased on the cipher systems described in this section.

Playfair Cipher

Playfair Cipher Notes How to use the Playfair Cipher in the manner employed by the National Cipher Challenge in 2004 for challenge 5b.

Digraph counter. A more complex tool which will analyse frequencies for double letter pairs. Use this tool on ciphers that you suspect are based on the Playfair system.


Playfair Cipher Wikipedia entry on Playfair Cipher systems.

Single Playfair Cipher Nova TV Nazi Secrets Program webpage on the Single Playfair Cipher. This is the system used for Cipher Challenge 2004 5B.

playfair.xls This XL worksheet will decipher the Cipher Challenge 2004 5b Playfair cipher, provided that you know the right keyword.

Double Playfair Cipher Nova TV Nazi Secrets Program webpage on the Double Playfair Cipher. This is exactly the system used for Cipher Challenge 2004 7B.

double playfair.xls This XL worksheet will decipher the Cipher Challenge 2004 7b double Playfair cipher, provided that you know the right keywords and how to arrange them in the grid.

Solitaire Cipher.

Solitaire Cipher. Wikipedia entry on Solitaire Ciphers.

Square Reversal

Square Reverser JavaScript square reversal tool.

Use this page to switch the columns and rows on a square block of ciphertext.

This is a tactic employed to add an extra degree of difficulty to various cypher systems. Suspect that this might have been done if the number of letters is a perfect square and you can't get the cribs that you expect in thetext to work.

Section 2. Transposition Ciphers.

Block Shuffle Systems.

TranspositionShuffle Ciphers Tools for attacking ciphers based on "shuffle" transpositions.

Railfence Systems.

Railfence Transposition Ciphers Tools for attacking ciphers based on "railfence" transpositions.

How to break these ciphers.

Challenges.

Railfence Challenges. Challenges using the 26 letter english alphabet based on the cipher systems described in this section.

Section 3. Poly-Alphabetic Substitution Ciphers.

Viginere System.

Poly-Alphabetic Tools Tools for attacking 26 letter alphabet based Viginere ciphers.

Keyword.

Poly-Alphabetic Tools Tools for attacking 26 letter alphabet based Viginere ciphers.

Autokey.

Poly-Alphabetic Tools Tools for attacking 26 letter alphabet based Viginere ciphers.

One Time Pad.

Poly-Alphabetic Tools Tools for attacking 26 letter alphabet based Viginere ciphers.

How to break these ciphers.

Poly-Alphabetic Tools Tools for attacking 26 letter alphabet based Viginere ciphers.

Poly-Alphabetic Word Guesser Tool for guessing target words in poly-alphabetic ciphers.

Digraph Ciphers

There is a huge variety of digraph ciphers. Most use a 26x26 grid with A-Z running across the top and down the side. The plaintext is broken up into two letter pairs. The first letter of the pair is used to find the x coordinate on the grid (across). The second letter gives the y coordinate (down). The grid square indicated contains the letter pair which is substituted for the original plain text pair, or vice versa in some cases.
There are 676 double letter pairs which means that digraph ciphers are effectively substitution ciphers with an alphabet of 676 pairs.

To break one of these ciphers use Digraph Counter. which counts the letter pairs.
Compare the stats from this analysis with those of a large sample of English plaintext; see digraph statistics.
Try to spot any "cribs" (known words or phrases) and use these to break into the letter grid.
Once you have a few letter pairs in place it might be possible to work out how the letter grid was constructed.

Digraph Tools Javascript tools for breaking most basic digraph ciphers. There are at leats 16224 variations on this sytem possible so do some frequency analysis work first.

Challenges.

Poly-Alphabetic Challenges. Challenges using the 26 letter english alphabet based on the cipher systems described in this section. Some of these are very hard indeed. Make sure you have fully understood the workings of the simpler cipher systems before tackling these.

Frequency Analysis

Frequency analysis is the bedrock of decryption. All you do is count how many times each letter appears and compare that letter distribution with that of the target language. If the message has simply been rearranged but not enciphered then the frequency distribution of the message will be the same as that of a standard passage of English.
If the message has been encoded with symbols or letter groups then a similar process can be applied.
Frequency analysis can also be done, quite effectively, with a pencil and paper.

Data graphs and tables. Frequency analysis results for standard English taken from huge samples of literature.


Code Frequencies. Frequency analysis using Excel VBA.


Multiple Cipher Frequencies. A more complex tool which will analyse frequencies for variable letter intervals. Use this tool on ciphers that you suspect are Viginere variations using a keyword.


Digraph counter. A more complex tool which will analyse frequencies for double letter pairs. Use this tool on ciphers that you suspect are based on the Playfair system. It can aslo be used on monoalphabetic ciphers in which the plaintext has been deliberately chosen to make analysis difficult.


JS Frequency Analysis. JavaScript frequency analysis tool. Gives results as a percentage.

EXCEL Programming

Simple Shift Cipher. Part 1Excel VBA Simple shift cipher. Using a spinner control to shift the alphabet.

Simple Shift Cipher. Part 2Excel VBA Using text boxes, command buttons and VBA programming to make and break mono-alphabetic substitution ciphers.

Frequency Analysis with Excel. Using a command button and a text box to generate letter frequency graphs and statistics.

Shuffle Transposition ToolExcel VBA. Uses textboxes, command buttons and a variety of Excel VBA commands to make or break shuffle cipher systems.

Viginere Cipher. Excel VBA Using text boxes, command buttons and VBA programming to make and break viginere or similar poly-alphabetic substitution ciphers. Can be used for running key or autokey ciphers. You should have mastered shift ciphers before tackling this type of cipher.

Ready Made Tools.

These are tools from last year's cypher challenge. They have not been cleaned up or made user-friendly!
You have been warned.

CodeTools This is useful for shift ciphers and jobs like striping out spaces or punctuation. It contains evert JavaScript tool which we have written so far. It doesn't look very pretty!

Shuffle Tools for breaking ciphers which feature shuffled letter groups.

Data graphs and tables. Frequency analysis results for standard English taken from huge samples of literature.


Code Frequencies. Frequency analysis using Excel VBA.


Multiple Cipher Frequencies. A more complex tool which will analyse frequencies for variable letter intervals. Use this tool on ciphers that you suspect are Viginere variations using a keyword.


Digraph counter. A more complex tool which will analyse frequencies for double letter pairs. Use this tool on ciphers that you suspect are based on the Playfair system.


JS Frequency Analysis. JavaScript frequency analysis tool. Gives results as a percentage.

Poly-Alphabetic Tools Tools for attacking 26 letter alphabet based Viginere ciphers.

Poly-Alphabetic Word Guesser Tool or guessing target words in poly-alphabetic ciphers.

Liebnitz Binary Cipher. Tool for deciphering binary substitution ciphers using five letter blocks of A's and B's. Ciphers that look like aabaa aaaba aabba etc.

Latin Alphabet Viginere. Latin alphabet viginere and shift cipher systems. (no J or V).

Codebreaker. Excel based code cracking tools. These are pretty rough and ready! Type the message you want to process into the top textbox.

playfair.xls This XL worksheet will decipher the Cipher Challenge 2004 5b Playfair cipher, provided that you know the right keyword.

double playfair.xls This XL worksheet will decipher the Cipher Challenge 2004 7b double Playfair cipher, provided that you know the right keywords and how to arrange them in the grid.

Useful Links

Cipher Challenge. The national cipher cracking competition homepage.

Bletchley Park resources page. Bletchley Park was Britains code breaking HQ during WWII. This page contains lesson plans and downloadable goodies.

GCHQ Cipher challenges (2005). GCHQ is Britains current government code breaking agency.

Simon Singh's Homepage. Simon Singh is the author of "The Codebook". His website provides an excellent introduction to the whole are a of codes, ciphers and code breaking.

Cryptology Links Page This page has a huge number of code cracking resources. We can't vouch for what they might do to your computer though!

Wikipedia Wikipedia has lots of very useful pages on all the ciphers that you are likely to encounter in the Cipher Challenge competition.

Nova TV Nazi Secrets page. This has a few pages on real cipher systems and three very, very hard decryption problems.

last updated 20th November 2007