Cipher Methods

Ciphers are based on algorithms that transform the plaintext into ciphertext. These algorithms may also require the application of a keyword that introduces another level of security and flexibility to the overall system. All systems of ciphers can be classified as transposition, substitution or a combination of both.

Transposition methods involve moving the plaintext characters into new positions in the ciphertext based on an algorithm or procedure. For example, each pair of characters (known as digraphs) can be swapped so that 'AN' becomes 'NA'. Obviously, the algorithm can become much more involved if needed.

One example of a transposition method is the Caesar square or rail-fence cipher. To encode for a four rail cipher, the first four letters are written on separate lines, the next four reuses the four lines (rails), and so on until the text is complete. This is the same as swapping rows and columns. Other examples of transposition methods are magic squares, knights tour and text inversion. Magic squares have each row or column summing to the same number. The numbers are the order in which the plaintext is repositioned in the ciphertext.

Substitution methods use mapping techniques that replace characters (or sometimes sets of characters) by other characters (or sets of characters). The mapping technique can be very simple such as replacing 'A' with 'Z', 'B' with 'Y' etc. (inversion) or 'A' with 'D' and 'B' with 'E' etc. (displacement or shift). But it can also be much more complex. With the introduction of teletypes and computers, characters can now be encoded using a binary technique. These binary representations are then manipulated with boolean operations for encipherment.

Monoalphabet Substitution

Monoalphabet substitution algorithms use a single character, symbol or digraph (2 character) mapping throughout the message. This leads to a relative ease of cryptanalysis (cipher cracking) based on statistical analysis of the source language. However, studying the methods of encryption and analysis for monoalphabets will lead to a better understanding of the entire field of cryptology.

Atbash is one of the oldest ciphers known and appears in the Hebrew Scriptures of the Bible. It is a cipher where occurrences of the first letter of the alphabet are replaced by the last, occurrences of the second by the second to last, etc. This is not very secure as a single test will indicate if it was used but it was sufficient enough when literacy was not widespread. Atbash is a specific example of the general technique called inversion.

Caesar is also a very old cipher. Letters are replaced by letters three steps further along in the alphabet. That is 'A' becomes 'D', 'B' becomes 'E' etc. In fact a Caesar cipher can use any size shift. Caesar ciphers can easily be 'cracked' as there is a finite number of mappings that can exist. Caesar cipher is a specific example of the general technique called displacement.

Keyword ciphers add a level of security in that even if the algorithm or technique is known, deciphering still requires a knowledge of a password or phrase. The most common form of use is to take the keyword (or phrase), discard any character repetitions, and then add any missing characters to the end of the string. This would form the replacement alphabet. As a example if the key phrase was 'GIVE ME LIBERTY OR GIVE ME DEATH' then the replacement phrase is 'GIVEMLBRTYODAHCFJKNPQSUWXZ'. 'A' is then mapped to 'G', 'B' is mapped to 'I' etc. The replacement phrase should be displaced or inverted to prevent problems with short key phrases leaving no mapping for latter part of alphabet. Passwords should be changed on a regular basis or even on a use once basis. Coupled with short texts to make frequency analysis difficult this is a fairly good enciphering technique as little skill is required to create the map on the fly.

Polybius checkerboards create 5x5 grids of letters (with 'I' and 'J' in the same cell). By numbering the columns and rows, any letter can be represented by a 2 digit number or digraph. For example 'K' would be column 5, row 2. This is an example of a fractional substitution code. Another example is the ADGFX code used in the First World War.

Playfair is a polygram cipher that modifies the Polybius checkerboard by introducing a key. The key phrase is used to fill in the cells of the table, but any letter already used is dropped. Once the key phrase has been used up, the remaining letters of the alphabet are inserted in strict alpha order till all cells are complete. Once again i and j are assumed equivalent for building the table. To encipher plaintext one uses digraphs (ie. two characters at a time) as input.

Reciprocal alphabets are those where if 'A' maps to 'N', then 'N' maps to 'A' for all characters. Atbash is one example of a reciprocal alphabet.

Folding is a technique where the alphabet is split at a certain point. For example a simple fold might occur at the midpoint of the alphabet. This would map 'A' to 'N', 'B' to 'O' etc. Note that this would also be a reciprocal alphabet.

The techniques of inversion, displacement, and folding could be intermixed to provide a more complex encipherment - decipherment technique. However this complexity does not change the method of analysis of a monoalphabet cipher!

Polyalphabet Substitution

Polyalphabet algorithms change the mapping schemes for letters (ie. 'A' does not always map to the same letter). The change can be periodic or random (rare as this makes deciphering difficult). The alternate maps can be generated in a variety of ways. The selection of the next alphabet is: sequential, keyword encoded, or autoencoded. Manual encyphering methods use tableaus or cipher disks.

Polyalphabet algorithms makes frequency count analysis much more difficult as the word 'the' will not reoccur as the same sequence. But techniques do exist to spot any periodicity in alphabet reuse and hence a clue as to keyword length.

Porta (1563) generates its tableau using first a folded map and then repeats with the second half shifted. This generates 13 unique maps. One is used for A|B in the keyword etc.

Vigenère (1586) generates its tableau of alpha-ordered maps with a simple displacement (Caesar shift of 1) for each line. A related keyword is used to select the line for the next letter's mapping. For example, if MILEY was the keyword, the first letter of plaintext would be coded by the M (13th) line, the second by the I (9th) line. After five letters the alphabets would be reused (ie the periodic order is 5).

Beauford (1857) generates its tableau by adding a 27th column and a 27th row. The last column and row are identical to the first. To Encipher a plaintext P with the key letter K, start at any row/column whose outside letter is P, follow that line to the letter K, then move along the perpendicular column/row to the outside letter.

Streamed Ciphers

Streamed ciphers combine plaintext characters or bytes with a pseudorandom stream, one character/byte at a time. Paper-and-pencil methods add characters as numbers (modulo 26). Computers normally combine bytes using XOR operation. StreamIt is a working example.

Mechanical

The 20th century brought mechanization to the art of generating ciphers. Rotor machines were invented just after the First World War by Hebern [USA], Koch [Netherlands] and Damm [Sweden]. These mechanical marvels used rotors (wheels), reflectors and later on, patch panels to map typewriter key input into lamp indicator output. Scherbius [Germany] improved the Koch machine and marketed it as the Enigma. See: Enigma, Purple, Ultra. The output was still ciphertext transmitted using traditional methods.

The development of teleprinters allowed machine-to-machine encyphering techniques to be used. The first encyphering scheme was Fish (aka Lorenz) which was broken by Tutte's mathematical/statistical analysis after some classic blunders by the coding operators.

Computerized

By the end of the second world war electronic technology had advanced to the point where computers could be used in cryptanalysis. Turing and Flowers were major contributors to the development of Colossus, the first programmable computer. It was first used to crack Tunny, a derivative of Fish. Another derivative was Sturgeon (used by the Luftwaffe).


JR's Home Page | Comments | [cymethod.htm:2013 05 01]