Вы находитесь на странице: 1из 16

Caesar cipher

Plain: Cipher: ABCDEFGHIJKLMNOPQRSTUVWXYZ DEFGHIJKLMNOPQRSTUVWXYZABC

Ciphertext: WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ Plaintext: the quick brown fox jumps over the lazy dog

Playfair Cipher

Example
Using "playfair example" as the key, (assuming I and J are interchangeable) the table becomes:

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

Encrypting the message "Hide the gold in the tree stump":


HI DE TH EG OL DI NT HE TR EX ES TU MP ^

1. The pair HI forms a rectangle, replace it with BM

2. The pair DE is in a column, replace it with OD

3. The pair TH forms a rectangle, replace it with ZB

4. The pair EG forms a rectangle, replace it with XD

5. The pair OL forms a rectangle, replace it with NA

6. The pair DI forms a rectangle, replace it with BE

7. The pair NT forms a rectangle, replace it with KU 8. The pair HE forms a rectangle, replace it with DM 9. The pair TR forms a rectangle, replace it with UI

10. The pair EX (X inserted to split EE) is in a row, replace it with XM

11. The pair ES forms a rectangle, replace it with MO 12. The pair TU is in a row, replace it with UV

13. The pair MP forms a rectangl e, replace it with IF

Vigenere cipher

Key: ABCDABCDABCDABCDABCDABCDABCD Plaintext: CRYPTOISSHORTFORCRYPTOGRAPHY Ciphertext: CSASTPKVSIQUTGQUCSASTPIUAQJB

Pigpen cipher

Beaufort cipher

Autokey Ciphher
Plaintext: ATTACK AT DAWN... Key: QUEENL YA TTACK AT DAWN.... Ciphertext: QNXEPV YT WTWP...

ADFGX Cipher

and j have been combined, to make the alphabet fit into a 5 5 grid.

Using this square, the message is converted to fractionated form: a t t a c k a t o n c e AF AD AD AF GF DX AF AD DF FX GF XF Next, the fractionated message is subject to a columnar transposition. We write out the message in rows under a transposition key (here, "CARGO"): C A R G O

_________ A F A D A D A F G F D X A F A D D F F X G F X F X Next, we sort the letters alphabetically in the transposition key (changing CARGO to ACGOR), rearranging the columns beneath the letters along with the letters themselves: A C G O R _________ F A D A A A D G F F X D F A A D D F X F F G F X X Then it is read off in columns, in keyword order, yielding the ciphertext: FAXDF ADDDG DGFFF AFAXX AFAFX

Four square cipher


As an example, here are the four-square matrices for the keywords "example" and "keyword." The plaintext matrices are in lowercase and the ciphertext matrices are in caps to make this example visually more simple:

a b c d e

E X A M P

f g h i j k l m n o p r s t u v w x y z 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

L B C D F G H I J K N O R S T U V W 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

[edit]Algorithm To encrypt a message, one would follow these steps: Split the payload message into digraphs. (HELLO WORLD becomes HE LL OW OR LD) Find the first letter in the digraph in the upper-left plaintext matrix.

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 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

E X A M P L B C D F G H I J K N O R S T U V W 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

Find the second letter in the digraph in the lower-right plaintext matrix.

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 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

E X A M P L B C D F G H I J K N O R S T U V W 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

The first letter of the encrypted digraph is in the same row as the first plaintext letter and the same column as the second plaintext letter. It is therefore in the upper-right ciphertext matrix.

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 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

E X A M P L B C D F G H I J K N O R S T U V W 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

The second letter of the encrypted digraph is in the same row as the second plaintext letter and the same column as the first plaintext letter. It is therefore in the lower-left ciphertext matrix.

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 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

E X A M P L B C D F G H I J K N O R S T U V W 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

Using the four-square example given above, we can encrypt the following plaintext: Plaintext: he lp me ob iw an ke no bi

Ciphertext: FY GM KY HO BX MF KK KI MD

Columnar transposition
In a columnar transposition, the message is written out in rows of a fixed length, and then read out again column by column, and the columns are chosen in some scrambled order. Both the width of the rows and the permutation of the columns are usually defined by a keyword. For example, the word ZEBRAS is of length 6 (so the rows are of length 6), and the permutation is defined by the alphabetical order of the letters in the keyword. In this case, the order would be "6 3 2 4 1 5". In a regular columnar transposition cipher, any spare spaces are filled with nulls; in an irregular columnar transposition cipher, the spaces are left blank. Finally, the message is read off in columns, in the order specified by the keyword. For example, suppose we use the keyword ZEBRAS and the message WE ARE DISCOVERED. FLEE AT ONCE. In a regular columnar transposition, we write this into the grid as: 6 W I R E E 3 E S E A Q 2 A C D T K 4 R O F O J 1 E V L N E 5 D E E C U

Providing five nulls (QKJEU) at the end. The ciphertext is then read off as: EVLNE ACDTK ESEAQ ROFOJ DEECU WIREE In the irregular case, the columns are not completed by nulls: 6 W I R E E 3 E S E A 2 A C D T 4 R O F O 1 E V L N 5 D E E C

This results in the following 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. Then he can write the message out in columns again, then re-order the columns by reforming the key word. Columnar transposition continued to be used for serious purposes as a component of more complex ciphers at least into the 1950's.

Bifid Ciphher Operation


First, a mixed alphabet Polybius square is drawn up: 1 B Q I F T 2 G P O C H 3 W N A L Y 4 K D X U V 5 Z S E M R

1 2 3 4 5

The message is converted to its coordinates in the usual manner, but they are written vertically beneath: F L E E A T O N C E 4 4 3 3 3 5 3 2 4 3 1 3 5 5 3 1 2 3 2 5 They are then read out in rows: 4 4 3 3 3 5 3 2 4 3 1 3 5 5 3 1 2 3 2 5

Then divided up into pairs again, and the pairs turned back into letters using the square: 44 33 35 32 43 13 55 31 23 25 U A E O L W R I N S In this way, each ciphertext character depends on two plaintext characters, so the bifid is a digraphic cipher, like the Playfair cipher. To decrypt, the procedure is simply reversed. Longer messages are first broken up into blocks of fixed length, called the period. Each block is then encrypted separately. Odd periods are slightly more secure than even periods.

Вам также может понравиться