0% found this document useful (0 votes)
2 views8 pages

CH 03

Uploaded by

mandardesurkar3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

CH 03

Uploaded by

mandardesurkar3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Cryptography and Network

Security, Finite Fields


From Third Edition
by William Stallings

Lecture slides by Mustafa Sakalli


so much modified..
Modular Operations
• Clock, uses a finite number of values, and loops
back from either end
• Associative, Distributive, Commutative,
• Identities: (0 + w)%n = w%n, (1·w)%n = w%n
• additive inv (-w)
• If a=mb (a,b,m all integers), b|a, b is divisor (*)
• Any group of integers: Zn ={0,1, … ,n-1}
• Form a commutative ring for addition
• with a multiplicative identity
• note some peculiarities
– if (a+b)≡(a+c)%(n) then b≡c%(n)
– but (ab)≡(ac)%(n) for all a,b,c Zn
then b≡ c%(n) only if a is relatively prime to n
%8 Example
Multiplication and inverses
a%(7), residue classes
[0] [1] [2] [3] [4] [5] [6]
-21 -20 -19 -18 -17 -16 -15
-14 -13 -12 -11 -10 -9 -8
-7 -6 -5 -4 -3 -2 -1
0 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 32 33 34
...
Table 4.2. Properties of Modular
Arithmetic for Integers in Zn
• Commutative laws (w + x) mod n = (x + w) mod n
(w x x) mod n = (x x w) mod n
• Associative laws
[(w + x) + y] mod n = [w + (x + y)] mod n
[(w x x) x y] mod n = [w x (x x y)] mod n
• Distributive laws
[w + (x + y)] mod n = [(w x x) + (w x y)] mod n
[w + (x x y)] mod n = [(w + x) x (w + y)] mod n

• Identities
(0 + w) mod n = w mod n
(1 + w) mod n = w mod n
• Additive inverse (-w)
For each w  Zn, there exists a z such that w + z ≡ 0 mod n
Relatively prime, Euclid's GCD Algorithm
• Numbers with gcd(a,b)=1 are relatively prime
– eg GCD(8,15) = 1
• an efficient way to find the GCD(a,b), uses
theorem that:
gcd(a,b) = gcd(b, a % b), (*)
• Euclid's Algorithm to compute GCD(a,b):
gcd(A, B)
1. While(B>0){
1. r  A % B;
2. A  B;
3. B  r;}
2. return A
Question is it possible to execute these in one line?
floor(ri-2 /ri-1) = ri
• A field Zn = {0,1,...,n-1} is a commutative ring in
which every nonzero element is assumed to have a
multiplicative inverse. ‘a’ is multiplicative inverse to
n, iff integer is relatively prime to n.

• Definition: If n is a prime p, then GF(p) is defined as


the set of integers Zp={0, 1,..., p-1}, + operations in
mod(p), then we can say the set Zn of integers
{0,1,...,n-1}, + operations in mod(n), is a
commutative ring. “Well-behaving”: the results of
operations obtained are confined in the field of
GF(p)

• We are interested in two finite fields of pn, where p


is prime,
– GF(p)
– GF(2n)

You might also like