Cryptology - Unofficial St. Mary's College of California Web Site
Cryptology - Unofficial St. Mary's College of California Web Site
Cryptology - Unofficial St. Mary's College of California Web Site
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
64 CHAPTER 4. THE EUCLIDEAN ALGORITHM<br />
in order for the multiplicative keynumber number k to have a multiplicative<br />
inverse, its greatest common divisor with 26 must be 1. And if so, the Extended<br />
Euclidean Algorithm computes the multiplicative inverse <strong>of</strong> k. This allows us<br />
to finalize our description <strong>of</strong> the multiplicative ciphers.<br />
Computing Keys for Decimation and Linear Ciphers:<br />
1) Pick an integer k.<br />
2) Use the Euclidean Algorithm to check that gcd(k, N) = 1.<br />
3) If not, pick a new k.<br />
4) If so, use the Euclidean Algorithm to find the inverse d. (If d is<br />
negative, use N + d instead.)<br />
Examples:<br />
(1) Decipher OXXMT MEB. It was enciphered with key 19m + 12 modulo 26.<br />
A Linear Cipher first multiplies and then divides. To undo this we must go<br />
backwards: first subtract and then “divide.” Dividing, <strong>of</strong> course, means<br />
multiplying by the inverse <strong>of</strong> 19 modulo 26, which from Figure 3.2 is 11.<br />
ciphertext O X X M T M E B<br />
ciphernumbers 15 24 24 13 20 13 5 2<br />
−12 3 12 12 1 8 1 -7 -10<br />
×11 33 132 132 11 88 11 -77 -110<br />
%26 7 4 4 9 20 9 15 14<br />
plaintext a d d i t i o n<br />
The answer is addition.<br />
(2) Decipher FRGPN I. The enciphering key was 14 modulo 27.<br />
First we need to find the inverse <strong>of</strong> 14 modulo 27:<br />
q<br />
1 1 1<br />
r<br />
c<br />
27<br />
0<br />
14<br />
1<br />
13<br />
−1<br />
The inverse is 2. So we decipher by multiplying by 2 modulo 27.<br />
The answer is linear.<br />
1<br />
2<br />
ciphertext F R G P N I<br />
ciphernumbers 6 18 7 16 14 8<br />
×2 12 36 14 32 28 16<br />
%27 12 9 14 5 1 16<br />
plaintext l i n e a r<br />
(3) May 13 be used as the multiplicative part <strong>of</strong> a key in a Decimation or<br />
Linear Cipher modulo 33<br />
Yes: gcd(33, 13) = 1. (We didn’t even need Euclid’s Algorithm for this<br />
one!)<br />
0