3
Cryptography Algorithm 1.Caesar's Cipher An extremely simple example of conventional cryptography is a substitution cipher. A substitution cipher substitutes one piece of information for another. This is most frequently done by offsetting letters of the alphabet. Two examples are Captain Midnight's Secret Decoder Ring, which you may have owned when you were a kid, and Julius Caesar's cipher. In both cases, the algorithm is to offset the alphabet and the key is the number of characters to offset it. For example, if we encode the word "SECRET" using Caesar's key value of 3, we offset the alphabet so that the 3rd letter down (D) begins the alphabet. So starting with ABCDEFGHIJKLMNOPQRSTUVWXYZ and sliding everything up by 3, you get DEFGHIJKLMNOPQRSTUVWXYZABCD where D=A, E=B, F=C, and so on. Using this scheme, the plaintext, "SECRET" encrypts as "VHFUHW." To allow someone else to read the ciphertext, you tell them that the key is 3. Algorithm 2.Sliding Scale or Cryptograph Slide the alphabet along by a certain number of letters, e.g. 1 letter: Plain text: 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 Code: B C D E F G H I J K L M N O P Q R S T U V W X

Cryptography (1)

Embed Size (px)

Citation preview

Page 1: Cryptography (1)

Cryptography

Algorithm 1.Caesar's Cipher

An extremely simple example of conventional cryptography is a substitution cipher. A substitution cipher substitutes one piece of information for another. This is most frequently done by offsetting letters of the alphabet. Two examples are Captain Midnight's Secret Decoder Ring, which you may have owned when you were a kid, and Julius Caesar's cipher. In both cases, the algorithm is to offset the alphabet and the key is the number of characters to offset it.

For example, if we encode the word "SECRET" using Caesar's key value of 3, we offset the alphabet so that the 3rd letter down (D) begins the alphabet.

So starting with

ABCDEFGHIJKLMNOPQRSTUVWXYZ

and sliding everything up by 3, you get

DEFGHIJKLMNOPQRSTUVWXYZABCD

where D=A, E=B, F=C, and so on.

Using this scheme, the plaintext, "SECRET" encrypts as "VHFUHW." To allow someone else to read the ciphertext, you tell them that the key is 3.

Algorithm 2.Sliding Scale or Cryptograph

Slide the alphabet along by a certain number of letters, e.g. 1 letter:

Plain text: 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 ZCode: 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

Example:SCOUT = TDPVU 

Page 2: Cryptography (1)

Algorithm 3. Transposition Ciphers   Rail Fence cipher  

Write the message letters out diagonally over a number of rows then read off cipher row by row. 

Example: Encrypting the following message using rail fence of depth 2:

“Meet me after the Graduation party” 

Write message out as: 

m e m a t r h g a u t o p r ye t e f e t e r d a i n a t Cipher text: MEMATRHGAUTOPRY ETEFETERDAINAT 

Algorithm4. Row Transposition

A more complex scheme. Write letters of message out in rows over a specified number of columns. Then reorder the columns according to some key before reading off the rows.

Example: using key 4, 3, 1, 2, 5, 6, 7 and plain text "attack postponed until two am" 

4 3 1 2 5 6 7  

a t t  a c k p 

o s t p o n e 

d u n t i l t 

w o a m * * * 

Cipher text: TTNA APTM TSUO AODW COI* KNL* PET*