Cryptography

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

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 Y Z A

Example:
SCOUT = TDPVU

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:


mematrhgautopry etefeterdainat 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 a o d 3 1 t s u t t n 2 a p t 5 6 7 c k p

o n e i l * t *

w o a

m *

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

You might also like