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.
4.3. MULTIPLICATIVE INVERSES 59<br />
(2) Find gcd(79, 201).<br />
q<br />
r 201<br />
2<br />
79<br />
1<br />
43<br />
1<br />
36<br />
5<br />
7<br />
7<br />
1 0<br />
gcd(79, 201) = 1.<br />
(3) Find gcd(182, 217).<br />
q<br />
r 182<br />
1<br />
35<br />
5<br />
7 0<br />
gcd(217, 182) = 5.<br />
⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄<br />
This process is called the Euclidean Algorithm, 3 and the general rule is that<br />
at any stage <strong>of</strong> four numbers in a triangle<br />
a<br />
q<br />
b<br />
we have q = a ÷ b, the quotient <strong>of</strong> the division, and r = a%b, the remainder.<br />
Even for large numbers the Euclidean Algorithm takes relatively few steps. 4<br />
r<br />
,<br />
Example: Compute gcd(191, 156)<br />
q<br />
r 191<br />
1<br />
156<br />
4<br />
35<br />
2<br />
16<br />
5<br />
3<br />
3<br />
1 0<br />
gcd(191, 156) = 1.<br />
⋄<br />
Being that this is math book, we should justify the algorithm, that is, explain<br />
how we know it always works. Fortunately this is easy. We know that gcd(a, b) =<br />
gcd(b, a%b), so by letting r = a%b, each consecutive pair <strong>of</strong> numbers in the “r<br />
line” has the same gcd. Since a > b > r ≥ 0, the values in the r line are<br />
positive but shrinking, so the algorithm must end. And when it does it, with<br />
a 0, because gcd(r, 0) = r the final non-zero entry equals the gcd <strong>of</strong> any two<br />
consecutive values in the line, in particular, the first two values in the line.<br />
4.3 Multiplicative Inverses<br />
For us to fully understand the multiplicative ciphers, decimation and linear, we<br />
need to know how to get from enciphering key to deciphering key. An extension<br />
3 An algorithm is a step-by-step procedure that solves a particular problem or produces<br />
some desired outcome. The word comes from the name <strong>of</strong> Mohammed ibn-Muse al-Khwarizmi,<br />
a mathematician in the royal court <strong>of</strong> Bagdad c. 800 A.D. Algebra likely also comes from his<br />
name.<br />
4 A theorem named for Gabriel Lamé, a French engineer, physicist and mathematician, says<br />
that the number <strong>of</strong> divisions needed to find the greatest common divisor <strong>of</strong> two numbers is<br />
no more than five times the number <strong>of</strong> decimal digits in the smaller <strong>of</strong> the two numbers.