
reshape - Builds a matrix from the cell array. arrayfun - Iterates over the row indices, calling circshift on each returns a cell array of the rows. The vigenere function uses three additional MATLAB functions: circshift - Creates each row of the Vigenere square.

On the final note: I've tried to make this breaker universal. Enter NONCANON and enjoy the completely deciphered text. Guess key allows you to try another variant quickly. By looking at the text's typos, you can easily guess that the 5th letter in the NONCNNON key is wrong. So, it is time to complete the puzzle and use the Guess key option. Yet, the deciphered text still has some typos. No wonder our most possible solution misfired. Note that it has a length of 8 (a multiplication of 4) and a repeating pattern NON-NON. It is easy to spot that the NONCNNON key gives much more sense. If you do so, you will see the table which lists the possible keys for each tried key length (by default, up to 30). So, it is time to click the Show another possible solutions button. However, the deciphered text has little sense. That's why I've included a couple of additional options for this decoder.Ĭonsider the following: Click to set example dataĪs you can see, the found key is NOOC. It can misfire for short text (of course, accuracy increases with the text's size) or if the key is very long or contains repeated patterns.
#Vigenere cipher series
Series of such Caesar ciphers give us the Vigenère cipher key.Īs you can see with the default calculator input data below, it could work very well. The Caesar cipher which gives the highest correlation is probably the Caesar cipher used in the Vigenère cipher. Now we need to try all possible combinations of Caesar cipher (26 for the English alphabet) and, for each result, compute the frequencies of letters and their correlation to average frequencies of letters in an English text.

The key length with the highest IOC is the probable cipher key length (or product of the multiplication of the key length). Text is broken into columns, corresponding to tested key length, and then average IOC for all columns is calculated.

IOC is used to find out the most likely key length.

In short, the procedure is the following: The application of the Index of Coincidence for the breaking of Vigenère cipher is described in Wikipedia. Then frequency analysis is used to break separate Caesar ciphers, which are simple single substitution ciphers. It is used to find the most likely key length. The technique used here to break the cipher is known as Friedman test or kappa test, invented in the 1920s, and it is based on Index of Coincidence or IOC.
