ASCII is a code used by computers to represent characters as numbers. This allows computers to store a letter as one byte of information. One byte of information allows you to represent 256 different values, which is enough to encode all the letters (uppercase and lowercase) as well as the numbers 0-9 and other special characters such as the @ symbol.
+ +The Atbash cipher is a very specific case of a Substitution Cipher where the letters of the alphabet are reversed. In otherwords, all As are replaced with Zs, all Bs are replaced with Ys, and so on.
+ +Because reversing the alphabet twice will get you actual alphabet, you can encipher and decipher a message using the exact same algorithm.
+ +ExampleThe Bifid Cipher uses a Polybius Square to encipher a message in a way that makes it fairly difficult to decipher without knowing the secret. This is because each letter in the ciphertext message is dependent upon two letters from the plaintext message. As a result, frequency analysis of letters becomes much more difficult.
+ +1 | 2 | 3 | 4 | 5 | +|
---|---|---|---|---|---|
1 | A | B | C | D | E | +
2 | F | G | H | I | K | +
3 | L | M | N | O | P | +
4 | Q | R | S | T | U | +
5 | V | W | X | Y | Z | +
The first step is to use the Polybius Square to convert the letters into numbers. We will be writing the numbers vertically below the message.
++secret message +411414 3144121 +353254 2533125 ++ +
The numbers are now read off horizontally and grouped into pairs.
+ +41 14 14 31 44 12 13 53 25 42 53 31 25+ +
The Polybius Square is used again to convert the numbers back into letters which gives us our ciphertext.
+ +qddltbcxkrxlk+ +
Since the first letter in the plaintext is encoded into the first and middle letters of the ciphertext, the recipient of the message must have the entire message before they can decode it. This means that if part of the ciphertext is discovered by a third party, it is unlikely that they will be able to crack it.
+ +To decipher a Bifid encrypted message, you first convert each letter into its corresponding number via the Polybius Square. Now, divide the long string of numbers into two equal rows. The digit in the top row and the digit in the bottom row will together reference the decoded letter in the Polybius Square.
+ +The Bifid Cipher can be taken into three dimensions to slightly increase the security of the message. This new cipher is called the Trifid Cipher.
+ + +A Caesar cipher is one of the simplest (and easiest cracked) encryption methods. It is a Substitution Cipher that involves replacing each letter of the secret message with a different letter of the alphabet which is a fixed number of positions further in the alphabet.
+ +Because each letter in the message has a direct translation to another letter, frequency analysis can be used to decipher the message. For example, the letter E is the most commonly used letter in the English language. Thus, if the most common letter in a secret message is K, it is likely that K represents E. Additionally, common word endings such as ING, LY, and ES also give clues.
+ +A brute-force approach of trying all 25 possible combinations would also work to decipher the message.
+ +ExampleIn this example, each letter in the plaintext message has been shifted 3 letters down in the alphabet.
+ +Plaintext: This is a secret messageIn a columnar transposition, the message is written out in rows of a fixed length. The message is then read out column by column, where the columns are chosen in some scrambled order. The number of columns and the order in which they are chosen is defined by a keyword. For example, the word ZEBRAS is 6 letters long. Therefore, there are 6 columns that will be read off in the following order: 6 3 2 4 1 5. The order is chosen by the alphabetical order of the letters in the keyword.
+ +Regular CaseIn a regular columnar transposition cipher, the empty spaces are filled with random letters. For example, suppose we use the keyword ZEBRAS and the message WE ARE DISCOVERED FLEE AT ONCE. Our grid would look like this:
+ +Z E B R A S +6 3 2 4 1 5 +- - - - - - +W E A R E D +I S C O V E +R E D F L E +E A T O N C +E Q K J E U ++ +
The six columns are now written out in the scrambled order defined by the keyword:
+ +EVLNE ACDTK ESEAQ ROFOJ DEECU WIREE+ +Irregular Case
In the irregular case, the empty letters are not filled in with random letters:
+ +Z E B R A S +6 3 2 4 1 5 +- - - - - - +W E A R E D +I S C O V E +R E D F L E +E A T O N C +E+ +
This results in the following (shorter) ciphertext:
+ +EVLNA CDTES EAROF ODEEC WIREE+ +
To decipher it, the recipient has to work out the column lengths by dividing the message length by the key length. This step is slightly more difficult if the irregular case is used. After determining the number of columns, the message can be written in columns and rearranged back into the plaintext message.
+ +Double Column TranspositionTo make the message even more difficult to decipher, you can take the ciphertext produced by this algorithm and run it through the encryption again using a different keyword. This transposes the columns twice and makes the message extremely difficult to decipher.
+ + + +The Keyword cipher is identical to the Caesar Cipher with the exception that the substitution alphabet used can be represented with a keyword.
+ +To create a substitution alphabet from a keyword, you first write down the alphabet. Below this you write down the keyword (omitting duplicate letters) followed by the remaining unused letters of the alphabet.
+ ++ABCDEFGHIJKLMNOPQRSTUVWXYZ +KEYWORDABCFGHIJLMNPQSTUVXZ ++ +
To encipher a plaintext message, you convert all letters from the top row to their correspondng letter on the bottom row (A to K, B to E, etc).
+ +These types of simple substitution ciphers can be easily cracked by using frequency analysis and some educated guessing.
+ + +Morse code is a method for transmitting information, using standardized sequences of short and long marks or pulses - commonly known as "dots" and "dashes" - for the letters, numerals, punctuation and special characters of a message.
+ +Originally created for Samuel Morse's electric telegraph in the mid-1830s, it was also extensively used for early radio communication beginning in the 1890s. However, with the development of more advanced communications technologies, the widespread use of Morse code is now largely obsolete.
+ +When using morse code, the timing is as follows: A dash is equal to three dots. A space between parts of the same letter is equal to one dot. A space between two letters is equal to three dots and a space between two words is equal to five dots.
+ + +The Playfair cipher encrypts pairs of letters (digraphs), instead of single letters. This is significantly harder to break since the frequency analysis used for simple substitution ciphers is considerably more difficult.
+ +Memorization of the keyword and 4 simple rules is all that is required to create the 5 by 5 table and use the cipher.
+ ++K E Y W O +R D A B C +F G H I J +L M N P S +T U V X Z ++
The Playfair cipher uses a 5 by 5 table containing a key word or phrase. To generate the table, one would first fill in the spaces of the table with the letters of the keyword (dropping any duplicate letters), then fill the remaining spaces with the rest of the letters of the alphabet in order (to reduce the alphabet to fit you can either omit "Q" or replace "J" with "I"). In the example to the right, the keyword is "keyword".
+ +To encrypt a message, one would break the message into groups of 2 letters. If there is a dangling letter at the end, we add an X. For example. "Secret Message" becomes "SE CR ET ME SS AG EX". We now take each group and find them on the table. Noticing the location of the two letters in the table, we apply the following rules, in order.
+ +To decipher, ignore rule 1. In rules 2 and 3 shift up and left instead of down and right. Rule 4 remains the same. Once you are done, drop any extra Xs that don't make sense in the final message and locate any missing Qs or any Is that should be Js.
+ + +A Polybius Square is a table that allows someone to translate letters into numbers. To give a small level of encryption, this table can be randomized and shared with the recipient. In order to fit the 26 letters of the alphabet into the 25 spots created by the table, the letters I and J are usually combined.
+ +1 | 2 | 3 | 4 | 5 | +|
---|---|---|---|---|---|
1 | A | B | C | D | E | +
2 | F | G | H | I | K | +
3 | L | M | N | O | P | +
4 | Q | R | S | T | U | +
5 | V | W | X | Y | Z | +
To encipher a message you replace each letter with the row and column in which it appears. For example, D would be replaced with 14.
+ +To decipher a message you find the letter that intersects the specified row and column.
++Plaintext: This is a secret +Ciphertext: 44232443 2443 11 431513421544 ++ +
In the rail fence cipher, the plaintext is written downwards on successive "rails" of an imaginary fence, starting a new column when the bottom is reached. The message is then read off in rows. For example, if we have 3 rails and a message of "This is a secret message", you would write out:
+ ++T S A C T S G +H I S R M S E +I S E E E A J ++ +
The last J is just a random letter to fill in the space. The secret message is then condensed and regrouped.
+ +TSACT SGHIS RMSEI SEEEA JGURL+ +
To decipher a message you must know the number of rails that were used to encipher it. You then break up the letters into equal groups for each rail. For example, if you are using 3 rails, you would break the secret message into 3 equal groups. Now you stack the groups on top of each other and read off the message vertically. If you get gibberish, then there are probably some extra letters tacked on the end of the message that are throwing off the grouping. Try removing one letter from the end and try again.
+ + +The Tap Code is a code (similar to Morse Code), commonly used by prisoners in jails to communicate with one another. The method of communicating is usually by "tapping" either the metal bars or the walls inside the cell, hence its name. It is a very simple code, not meant to avoid interception, since the messages are sent in cleartext.
+ +1 | 2 | 3 | 4 | 5 | +|
---|---|---|---|---|---|
1 | A | B | C | D | E | +
2 | F | G | H | I | J | +
3 | L | M | N | O | P | +
4 | Q | R | S | T | U | +
5 | V | W | X | Y | Z | +
It was reportedly invented by four POWs imprisoned in Vietnam and is sometimes called "Smitty Code" after Captain Carlyle ("Smitty") Harris. Harris remembered an Air Force instructor who had shown him a code based on a five-by-five alphabet matrix (a Polybius square), as shown on the graph.
+ +Each letter was communicated by tapping two numbers. The first designated the horizontal row and the second designated the vertical row. The letter "X" was used to break up sentences and the letter "C" replaced the letter "K".
+ + +For example, to communicate the word "WATER" the code would be the following
++..... .. . . .... .... . ..... .... .. ++ +
Because of the difficulty and length of time required for specifying a single letter, most prisoners devised abbreviations and acronyms for common items or phrases.
+ + +The Trifid Cipher is the Bifid Cipher taken to one more dimension. Instead of using a 5x5 Polybius Square, you use a 3x3x3 cube. Otherwise everything else remains the same. As with the Bifid Cipher, the cube can be mixed to add an extra layer of protection, but for these examples we will not be using a mixed alphabet cube.
+ +Layer 1 | |||
1 | 2 | 3 | |
---|---|---|---|
1 | A | B | C |
2 | D | E | F |
3 | G | H | I |
Layer 2 | |||
1 | 2 | 3 | |
---|---|---|---|
1 | J | K | L |
2 | M | N | O |
3 | P | Q | R |
Layer 3 | |||
1 | 2 | 3 | |
---|---|---|---|
1 | S | T | U |
2 | V | W | X |
3 | Y | Z | . |
The first step is to use the cube to convert the letters into numbers. We will be writing the numbers vertically below the message in the order of Layer, Column, Row.
+ ++secret message +311213 2133111 +123322 1211112 +121321 2211132 ++ +
The numbers are now read off horizontally and grouped into triplets.
+ +311 213 213 311 112 332 212 111 121 213 212 211 132+ +
The cube is used again to convert the numbers back into letters which gives us our ciphertext.
+ +sppsdxmabpmjf+ +
To decipher a Trifid encrypted message, you first convert each letter into its corresponding number via the cube. Now, divide the long string of numbers into three equal rows. Now, read off each column and use the cube to convert the three numbers into the plaintext letter.
+ + +