<<

Transposition Rail Fence : Number of rows. : Write plaintext in a grid with given number of row by writing columns (top-to- bottom, left-to-right). Then write the rows out (left-to-right, top-to-bottom) to produce the . Decryption: Count the number of characters and use the division algorithm with the number of rows to recreate the grid. Write the ciphertext in rows (left-to-right, top -to-bottom). Last, write out columns (top-to-bottom, left-to-right) to produce plaintext.

Monoalphabetic Substitution Ciphers Affine Key: Pair of numbers (a, b) with a in {1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 25} and b in {0, 1, 2, ..., 25}. Encryption: Work with each letter of plaintext separately. Convert letter to “alphabet position number” in {0, 1, ..., 25}. First, multiply by a and then add b both mod 26. Convert resulting number back to letter of alphabet. Decryption: Work with each letter of ciphertext separately. Convert letter to “alphabet position number” in {0, 1, ..., 25}. First, add (26 − b) and then multiply by x, both mod 26, where x is the unique number satisfying x · a = 1 (mod 26). Convert resulting number back to letter of alphabet. Additive Cipher (or Caesar Shift) Perform affine cipher with a = 1. The key is thus only b. Multiplicative Cipher Perform affine cipher with b = 0. The key is thus only a. Keyword Cipher Key: A chosen keyword. Encryption: Write the alphabet as usual. Directly below, write the keyword leaving off letters that have already appeared. After the keyword, write the alphabet (in usual order) skipping letters that have already appeared. To encrypt, work with each letter of plaintext separately reading from standard alphabet down to cipher alphabet. Decryption: Work with each letter of ciphertext separately reading from cipher alphabet up to standard alphabet. Fabricated Substitution (Pigpen for instance) 1. Key: A table describing the correspondence between alphabet letters and 26 alternate char- acters (possibly the usual alphabet in different order). 2. Encrypt/Decrypt by using the correspondence described in the table. Polyalphabetic Substitution Ciphers Key: A chosen keyword. Encryption: Create a 5 × 5 grid using a similar process to keyword : write the keyword (removing repeated letters) and then write the rest of the alphabet in order, skipping letters already used for the keyword. We also combine ‘I/J’ into a single letter. Then, first break the plaintext into two-character blocks (add X’s to split up double letters and at the end if odd number of characters). For each two-character block, exactly one of the following occurs:

(a) The two characters are in the same row: in this case, replace the two characters by the letters to the immediate right of each (wrapping to the beginning of the row if necessary). (b) The two characters are in the same column: in this case, replace the two characters by the letters immediately beneath each (wrapping to the top of the column if necessary). (c) The two characters are in different rows and different columns: in this case, replace the char- acters by the two characters sharing a row/column relationship with the two characters (use rows of plaintext characters to determine order). Use the encrypted character-pairs to form the ciphertext. Decryption: Use the same 5 × 5 grid as above. First, break the ciphertext into two-character blocks. For each two-character block, one of the following occurs:

(a) The two characters are in the same row: in this case, replace the two characters by the letters to the immediate left of each (wrapping to the end of the row if necessary). (b) The two characters are in the same column: in this case, replace the two characters by the letters immediately above each (wrapping to the bottom of the column if necessary). (c) The two characters are in different rows and different columns: in this case, replace the char- acters by the two characters sharing a row/column relationship with the two characters (use rows of plaintext characters to determine order). Use the decrypted character-pairs to form the plaintext. Vigen`ereCipher Key: A chosen keyword. Encryption: Create the Vigen`eresquare/table (or just use the rows, i.e. Caesar shifts, corre- sponding to the letters of the keyword). Write the plaintext; directly above the plaintext, write the keyword repeatedly until the end of the plaintext. For each character in the plaintext, use the plaintext letter to determine the column and the keyword letter above to determine the row. The entry in the specified row and column in the Vigen`eresquare is the cipher letter. Decryption: Use the same table as above. Write the ciphertext; directly above the ciphertext, write the keyword repeatedly until the end of the ciphertext. For each character in the ciphertext, locate the ciphertext letter in the row of the corresponding keyword letter. The column containing this letter gives the plaintext letter.