Ch02 Crypto7e
Ch02 Crypto7e
y and
Network
Security
Seventh Edition, Global Edition
by William Stallings
Chapter 2
Introduction to Number Theory
• If a | b and b | a, then a = ±b
• Any b ≠ 0 divides 0
• If a | b and b | c, then a | c
11 | 66 and 66 | 198 =
11 | 198
• If b | g and b | h, then b | (mg + nh) for
arbitrary integers m and n
© 2017 Pearson Education, Ltd., All rights reserved.
Properties of
Divisibility
• To see this last point, note that:
• If b | g , then g is of the form g = b * g1 for some
integer g1
• If b | h , then h is of the form h = b * h1 for some
integer h1
• So:
• mg + nh = mbg1 + nbh1 = b * (mg1 + nh1 )
b = 7; g = 14; h = 63; m = 3; n
and therefore b divides mg + nh
=2
7 | 14 and 7 | 63.
To show 7 (3 * 14 + 2 * 63),
we have (3 * 14 + 2 * 63) = 7(3 * 2
+ 2 * 9),
and it is obvious that 7 | (7(3 * 2 +
© 2017 Pearson Education, Ltd., All rights reserved.
Division Algorithm
a = qn + r 0 ≤ r < n; q =
[a/n]
m • Procedure for
determining the
greatest common
divisor of two
positive integers
• Congruent modulo n
• Two integers a and b are said to be
congruent modulo n if (a mod n) = (b
mod n)
• This is written as a = b(mod n)2
• Note that if a = 0(mod n), then n | a
1. a = b (mod n) if n (a – b)
Additive
and
Multiplicativ
e Inverse
Modulo 8
© 2017 Pearson Education, Ltd., All rights reserved.
(This table can be found on page 37 in the textbook)
Table 2.3
Properties of Modular Arithmetic for
Integers in Zn
a= p1
a1
* p2 a2
* . . . * pp1 a1
© 2017 Pearson Education, Ltd., All rights reserved. (This table can be found on page 44 in the textbook)
Fermat's Theorem
• States the following:
• If p is prime and a is a positive integer
not divisible by p then
ap-1 = 1 (mod p)
• An alternate form is:
• If p is prime and a is a positive integer
then
ap = a (mod p)
© 2017 Pearson Education, Ltd., All rights reserved.
Table 2.6
Some Values of Euler’s Totient
Function ø(n)
© 2017 Pearson Education, Ltd., All rights reserved. (This table can be found on page 48 in the textbook)
Euler's Theorem
aø(n) = 1(mod n)
aø(n)+1 = a(mod n)
• Algorithm is:
TEST (n)
1. • Find integers k, q, with k > 0, q odd, so that (n – 1)=2kq ;
4. • for j = 0 to k – 1 do
6. • return (“composite") ;
© 2017 Pearson Education, Ltd., All rights reserved. (This table can be found on page 57 in the textbook)
Table 2.8
Tables of Discrete Logarithms, Modulo 19