Classical cipher
Encyclopedia
A cipher
Cipher
In cryptography, a cipher is an algorithm for performing encryption or decryption — a series of well-defined steps that can be followed as a procedure. An alternative, less common term is encipherment. In non-technical usage, a “cipher” is the same thing as a “code”; however, the concepts...

 is a means of concealing a message, where letters of the message are substituted or transposed for other letters, letter pairs, and sometimes for many letters. In cryptography
Cryptography
Cryptography is the practice and study of techniques for secure communication in the presence of third parties...

, a classical cipher is a type of cipher that was used historically but now has fallen, for the most part, into disuse. In general, classical ciphers operate on an alphabet of letters (such as "A-Z"), and are implemented by hand or with simple mechanical devices. They are probably the most basic types of ciphers, which made them not very reliable, especially after new technology was developed. Modern schemes use computer
Computer
A computer is a programmable machine designed to sequentially and automatically carry out a sequence of arithmetic or logical operations. The particular sequence of operations can be changed readily, allowing the computer to solve more than one kind of problem...

s or other digital technology, and operate on bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

s and byte
Byte
The byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...

s. Many classical ciphers were used by well-respected people, such as Julius Caesar
Julius Caesar
Gaius Julius Caesar was a Roman general and statesman and a distinguished writer of Latin prose. He played a critical role in the gradual transformation of the Roman Republic into the Roman Empire....

 and Napoleon, who created their own ciphers which were then popularly used. Many ciphers had their origins in the military and were used for transporting secret messages among people on the same side. Classical schemes are often susceptible to ciphertext-only attack
Ciphertext-only attack
In cryptography, a ciphertext-only attack or known ciphertext attack is an attack model for cryptanalysis where the attacker is assumed to have access only to a set of ciphertexts....

s, sometimes even without knowledge of the system itself, using tools such as frequency analysis
Frequency analysis
In cryptanalysis, frequency analysis is the study of the frequency of letters or groups of letters in a ciphertext. The method is used as an aid to breaking classical ciphers....

. Sometimes grouped with classical ciphers are more advanced mechanical or electro-mechanical cipher machines, such as the Enigma machine
Enigma machine
An Enigma machine is any of a family of related electro-mechanical rotor cipher machines used for the encryption and decryption of secret messages. Enigma was invented by German engineer Arthur Scherbius at the end of World War I...

.

Types of Classical ciphers

Classical ciphers are often divided into transposition cipher
Transposition cipher
In cryptography, a transposition cipher is a method of encryption by which the positions held by units of plaintext are shifted according to a regular system, so that the ciphertext constitutes a permutation of the plaintext. That is, the order of the units is changed...

s
and substitution cipher
Substitution cipher
In cryptography, a substitution cipher is a method of encryption by which units of plaintext are replaced with ciphertext according to a regular system; the "units" may be single letters , pairs of letters, triplets of letters, mixtures of the above, and so forth...

s
.

Substitution ciphers

In a substitution cipher, letters (or groups of letters) are systematically replaced throughout the message for other letters (or groups of letters).

A well-known example of a substitution cipher is the Caesar cipher
Caesar cipher
In cryptography, a Caesar cipher, also known as a Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number...

. To encrypt a message with the Caesar cipher, each letter of message is replaced by the letter three positions later in the alphabet. Hence, A is replaced by D, B by E, C by F, etc. Finally, X, Y and Z are replaced by A, B and C respectively. So, for example, "WIKIPEDIA" encrypts as "ZLNLSHGLD". Caesar rotated the alphabet by three letters, but any number works.

Another method of substitution cipher is based on a keyword. All spaces and repeated letters are removed from a word or phrase, which the encoder then uses as the start of the cipher alphabet. The end of the cipher alphabet is the rest of the alphabet in order without repeating the letters in the keyword. For example, if the keyword is CIPHER, the cipher alphabet would look like this:

normal alphabet: a b c d e f g h i j k l m n o p q r s t u v w x y z

cipher alphabet: c i p h e r s t u v w x y z a b d f g j k l m n o q

The previous examples were all examples of monoalphabetic substitution ciphers, where just one cipher alphabet is used. It is also possible to have a polyalphabetic substitution cipher
Polyalphabetic cipher
A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. The Vigenère cipher is probably the best-known example of a polyalphabetic cipher, though it is a simplified special case...

, where multiple cipher alphabets are used. The encoded would just make up two or more cipher alphabets using whatever techniques he or she chooses, and then encode their message, alternating what cipher alphabet is used with every letter or word. This makes the message much harder to decode because the codebreaker would have to figure out both cipher alphabets.

Another example of a polyalphabetic substitution cipher that is much more difficult to decode is the Vigenère square, an innovative encoding method. With the square, there are 26 different cipher alphabets that are used to encrypt text. Each cipher alphabet is just another rightword Caesar shift of the original alphabet. This is what a Vigenère square looks like:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
Z A B C D E F G H I J K L M N O P Q R S T U V W X Y

To use the Vigenère square to encrypt a message, you first choose a keyword and then repeat it is the same length as the message you wish to encode. You then would write the message underneath the repeated keyword to see which cipher alphabet you would use for each letter of the message. The first letter of the message would be encoded using the cipher alphabet that corresponds with the first letters of the keyword. The cipher alphabet that uses B for A and C for B etc. would be cipher alphabet 'B'. Each cipher alphabet is named by the first letter in it. For example if you have a keyword of WORD and the message you want to encode is I LOVE CRYPTOGRAPHY, this is what you would do:

message: I LOVE CRYPTOGRAPHY

keyword: W ORDW ORDWORDWORDW

encoded text:E ZFYA QIBLHFJNOGKU

Some substitution ciphers involve using numbers instead of letters. An example of this is the Great Cipher
Great Cipher
In the history of cryptography, the Great Cipher or Grand Chiffre was a nomenclator cipher developed by the Rossignols, several generations of whom served the French Crown as cryptographers. The Great Cipher was excellent of its class and so was given this name; it was reputed to be unbreakable...

, where numbers were used to represent syllables. There is also another number substitution cipher that involves having four different number pair options for a letter based
on a keyword.

Instead of numbers, symbols can also be used to replace letters or syllables. One example of this is Zodiac
Zodiac
In astronomy, the zodiac is a circle of twelve 30° divisions of celestial longitude which are centred upon the ecliptic: the apparent path of the Sun across the celestial sphere over the course of the year...

 alphabet, where signs of the zodiac were used to represent different letters, for example, the symbols for the sun stood for A, Jupiter stood for B, and Saturn stood for C. Dots, lines, or dashes could also be used, one example of this being Morse Code
Morse code
Morse code is a method of transmitting textual information as a series of on-off tones, lights, or clicks that can be directly understood by a skilled listener or observer without special equipment...

, which isn't really a cipher, but uses dots and dashes as letters nonetheless. The pigpen cipher
Pigpen cipher
The pigpen cipher is a geometric simple substitution cipher which exchanges letters for symbols which are fragments of a grid...

 uses a grid system or lines and dots to establish symbols for letters. There are various other methods that involve substituting letters of the alphabet with symbols or dots and dashes.

Transposition ciphers

In a transposition cipher, the letters themselves are kept unchanged, but their order within the message is scrambled according to some well-defined scheme. Many transposition ciphers are done according to a geometric design. A simple (and once again easy to crack) encryption would be to write every word backwards. For example "Hello my name is Alice." would now be "olleH ym eman si ecilA." A scytale
Scytale
In cryptography, a scytale is a tool used to perform a transposition cipher, consisting of a cylinder with a strip of parchment wound around it on which is written a message...

 is a machine that aids in the transposition of methods.

In a columnar cipher, the original message is arranged in a rectangle, from left to right and top to bottom. Next, a key is chosen and used to assign a number to each column in the rectangle to determine the order of rearrangement. The number corresponding to the letters in the key is determined by their place in the alphabet, i.e. A is 1, B is 2, C is 3, etc. For example, if the key word is CAT and the message is THE SKY IS BLUE, this is how you would arrange your message:

C A T
3 1 20
T H E
S K Y
I S B
L U E

Next, you take the letters in numerical order and that is how you would transpose the message. You take the column under A first, then the column under C, then the column under T, as a result your message "The sky is blue" has become: HKSUTSILEYBE

In the Chinese cipher's method of transposing, the letters of the message are written from right to left, down and up columns to scramble the letters. Then, starting in the first row, the letters are taken in order to get the new ciphertext
Ciphertext
In cryptography, ciphertext is the result of encryption performed on plaintext using an algorithm, called a cipher. Ciphertext is also known as encrypted or encoded information because it contains a form of the original plaintext that is unreadable by a human or computer without the proper cipher...

. For example, if the message needed to be enciphered was THE DOG RAN FAR, the Chinese cipher would look like this:

R R G T
A A O H
F N D E

The cipher text then reads: RRGT AAOH FNDE

Many transposition ciphers are similar to these two examples, usually involving rearranging the letters into rows or columns and then taking them in a systematic way to transpose the letters. Other examples include the Vertical Parallel and the Double Transposition Cipher.

More complex algorithm
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

s can be formed by mixing substitution and transposition in a product cipher
Product cipher
In cryptography, a product cipher combines two or more transformations in a manner intending that the resulting cipher is more secure than the individual components to make it resistant to cryptanalysis. The product cipher combines a sequence of simple transformations such as substitution,...

; modern block cipher
Block cipher
In cryptography, a block cipher is a symmetric key cipher operating on fixed-length groups of bits, called blocks, with an unvarying transformation. A block cipher encryption algorithm might take a 128-bit block of plaintext as input, and output a corresponding 128-bit block of ciphertext...

s such as DES
Data Encryption Standard
The Data Encryption Standard is a block cipher that uses shared secret encryption. It was selected by the National Bureau of Standards as an official Federal Information Processing Standard for the United States in 1976 and which has subsequently enjoyed widespread use internationally. It is...

 iterate through several stages of substitution and transposition.

Cryptanalysis of classical ciphers

Classical ciphers are commonly quite easy to break. Many of the classical ciphers can be broken even if the attacker only knows sufficient ciphertext and hence they are susceptible to a ciphertext-only attack
Ciphertext-only attack
In cryptography, a ciphertext-only attack or known ciphertext attack is an attack model for cryptanalysis where the attacker is assumed to have access only to a set of ciphertexts....

. Some classical ciphers (e.g. the Caesar cipher
Caesar cipher
In cryptography, a Caesar cipher, also known as a Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number...

) have a small key space. These ciphers can be broken with a brute force attack
Brute force attack
In cryptography, a brute-force attack, or exhaustive key search, is a strategy that can, in theory, be used against any encrypted data. Such an attack might be utilized when it is not possible to take advantage of other weaknesses in an encryption system that would make the task easier...

, that is by simply trying out all keys. Substitution ciphers can have a large key space, but are often susceptible to a frequency analysis
Frequency analysis
In cryptanalysis, frequency analysis is the study of the frequency of letters or groups of letters in a ciphertext. The method is used as an aid to breaking classical ciphers....

, because for example frequent letters in the plaintext language correspond to frequent letters in the ciphertexts. Polyalphabetic ciphers such as the Vigenère cipher
Vigenère cipher
The Vigenère cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution....

 prevent a simple frequency analysis by using multiple substitutions. However, more advanced techniques such as the Kasiski examination
Kasiski examination
In cryptanalysis, Kasiski examination is a method of attacking polyalphabetic substitution ciphers, such as the Vigenère cipher...

 can still be used to break these ciphers.

On the other hand, modern ciphers are designed to withstand much stronger attacks than ciphertext-only attacks. A good modern cipher must be secure against a wide range of potential attacks including known-plaintext attack
Known-plaintext attack
The known-plaintext attack is an attack model for cryptanalysis where the attacker has samples of both the plaintext , and its encrypted version . These can be used to reveal further secret information such as secret keys and code books...

s and chosen-plaintext attack
Chosen-plaintext attack
A chosen-plaintext attack is an attack model for cryptanalysis which presumes that the attacker has the capability to choose arbitrary plaintexts to be encrypted and obtain the corresponding ciphertexts. The goal of the attack is to gain some further information which reduces the security of the...

s as well as chosen-ciphertext attack
Chosen-ciphertext attack
A chosen-ciphertext attack is an attack model for cryptanalysis in which the cryptanalyst gathers information, at least in part, by choosing a ciphertext and obtaining its decryption under an unknown key. In the attack, an adversary has a chance to enter one or more known ciphertexts into the...

s. For these ciphers an attacker should not be able to find the key even if he knows any amount of plaintext and corresponding ciphertext and even if he could select plaintext or ciphertext himself. Classical ciphers do not satisfy these much stronger criteria and hence are no longer of interest for serious applications.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK