{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS172-283 &acirc;€“ Class 2 &acirc;€“ Affine Cipher Example &acirc;€“ 20090908

# CS172-283 â€“ Class 2 â€“ Affine Cipher Example â€“ 20090908

This preview shows page 1. Sign up to view the full content.

Affine Cipher Example from Class 2 – September 8, 2009 Let m = 26, a = 3 and b = 5 now a and m must be co-prime so lets check GDC (a,m) = GCD (3,26) = 1 => Thus a, and m are, in fact, co-prime Now lets determine the inverse of a, remembering that a -1 *a 1 mod(m) pick a -1 = 9 and test to see if the above identity is true. a -1 *a 1 mod(m) = 9*3 mod 26) = 27 mod(26) = 1 thus a -1 = 9. Now we can use the values of a, b, and m to ecrypt some plaintext using the Affine cipher. Start with Plaintext=============================================== G O A T Convert plaintext English to numeric equivalent (range 0-25) to get x 6 14 0 19 Apply the encryption function on the plaintext by first computing ax+b, that is, 3X+5 23 47 5 62 Then apply mod(m) = mod(26) to get the values for the ciphertext, y
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 23 21 5 10 Convert the result back to English letters to obtain ciphertext x v f k Now lets reverse the operation to compute the plaintext x from the ciphertext y Start with the ciphertext============================================ x v f k Convert ciphertext English to numeric equivalent (range 0-25) to get y 23 21 5 10 Apply the decryption function on the ciphertext by first computing y-b, that is, y-5 18 16 5 Now multiply the result by the inverse of a which is a-1 = 9 162 144 45 Now apply mod(m) = mod(26) on the values to get the plaintext 6 14 19 Convert the result back to English letters to obtain the plaintext G O A T CS172/283 – Class 2 – Affine Cipher Example – 20090908 Page 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online