Basic Cryptography
Monoalphabetic Substitution Cipher
The monoalphabetic substitution cipher involves replacing each letter of the alphabet with a different letter coming from a shifted set of letters. For instance, the following is the perhaps the most simplest substitution cipher known as the Ceaser cipher:
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
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 <-- shifted 3 letters
This algorithm would be: CT = (PT + 3) mod 26 where CT is CipherText, PT is PlainText.
So the following message on line 1 can be encrypted as line 2.
Line 1: pick up supplies at location x
Line 2: SLFN
XT VXTTOLHV DW ORFDWLRQ A
In order to easily break a monoalphabetic substitution cipher some knowledge of the language must be known, such as the relative frequency of of letters. For instance, the English language the most frequent letter used is 'e' and the second most frequent letter used is 't' and so on. Another approach would be to look at digrams. Digrams are 2 letter combinations such as 'th'. So if one wanted to make this more difficult to crack then it is important to flatten out the relative frequency of letter substitutions by assigning letters to more than one. The Playfair and Hill cipher do just that.
Polyalphabetic Substitution Cipher
The polyalphabetic substitution cipher uses multiple monoalphabetic substitution ciphers of which a key determines which one to use. For instance,
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
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
Line 1 would be the key, Line 2 would be the plain text and Line 3 is the ciphertext below.
Line 1: hikehikehikehikehike
Line 2: meetmeatnooninlondon
Line 3: TMOXTMKXUWYRPVVSULYR
So one would go down the first column to find the h's row. The first letter of the plain text message is 'm' so then intersection of the 'm' column and the 'h' row produces the ciphered letter 'T'. The next letter in the key is 'i' and 'e' in the plain text message. Naturally enough the next ciphered letter is the intersection of the 'i' row and 'e' column with produces 'M'. Probably the most popular polyalphabetic substitution cipher is the Vigenere cipher.
This technique flattens out the relative letter frequency. However, this technique isn't too secure either because the length of the key can determine which monoalphabetic substitution cipher to use. So the draw back to making this technique as tough as possible would be to make the key as long as the plaintext. Gilbert Vernam an AT&T employee in 1918 introduced this concept.
Transposition Cipher
Transposition ciphers simply scramble the order of the letters in a plain text message. For instance, the message: turnrightthenturnleftthengostraight could be transposed as
|
turnright |
} |
ttesuhftretrnntarthiiueggrnhhngttlo |
The transposition cipher is fairly easy to crack. One could play around with various column positions and utilize language frequencies such as digrams, etc. However, to make this more difficult one could encrypt the message first and then transpose the letters.
Rotor Cipher
View http://www.bletchleypark.net/stationx/enigma.html.
Links
http://www.tropsoft.com
http://www.entrust.com
http://www.anticode.com
http://www.trusecure.com
http://www.redsiren.com
http://philzimmermann.com
http://csrc.nist.gov/encryption
http://web.mit.edu/kerberos/www
http://www.infosecuritymag.com
http://world.std.com/~franl/crypto
http://www.cacr.math.uwaterloo.ca/hac/
http://www.pbs.org/wgbh/nova/decoding/
http://www.counterpane.com/twofish.pdf
http://www.eskimo.com/~weidai/cryptlib.html
http://theory.lcs.mit.edu/~rivest/publications.html
http://www.youdzone.com/cryptobooks_History.html
http://directory.google.com/Top/Computers/Security/
http://webhome.idirect.com/~jproc/crypto/terms.html
http://www.simonsingh.net/Crypto_Links.html
http://www.privacy.nb.ca/cryptography/archives/cryptography/