Professional Documents
Culture Documents
Chap4 Network Security 2023 (1)
Chap4 Network Security 2023 (1)
E3
N
C
U
AC
08
will now introduce finite fields
E3
of increasing importance in cryptography
N
• AES, Elliptic Curve, IDEA, Public Key
C
concern operations on “numbers”
U
• where what constitutes a “number” and the type of
AC
08
E3
• say a non-zero number b divides a if for some m have a=mb (a,b,m
all integers)
N
• that is b divides into a with no remainder
• denote this b|a
C
U
• and say that b is a divisor of a
AC
08
a = qn + r
E3
• where 0 <= r < n; remainder r often referred to as a residue
N
q = floor(a/n)
C
U
AC
08
divided by n
E3
• where integer n is called the modulus
• r is called a residue (remainder) of a mod n
N
• q is called a quotient of a mod n
C
• since with integers can always write: a = qn + r
U
• usually chose smallest positive remainder as residue
AC
+ 0 1 2 3 4 5 6 7 * 0 1 2 3 4 5 6 7
08
0 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0
E3
1 1 2 3 4 5 6 7 0 1 0 1 2 3 4 5 6 7
N
2 2 3 4 5 6 7 0 1 2 0 2 4 6 0 2 4 6
C
U
3 3 4 5 6 7 0 1 2 3 0 3 6 1 4 7 2 5
AC
4 4 5 6 7 0 1 2 3 4 0 4 0 4 0 4 0 4
08
a common problem in number theory
GCD (a,b) of a and b is the largest integer that divides evenly
into both a and b
E3
eg GCD(60,24) = 12
define gcd(0, 0) = 0
N
often, we want no common factors (except 1) define such
numbers as relatively prime
C
U
eg GCD(8,15) = 1
hence 8 & 15 are relatively prime
AC
08
1970 = 1 x 1066 + 904 gcd(1066, 904)
1066 = 1 x 904 + 162 gcd(904, 162)
E3
904 = 5 x 162 + 94 gcd(162, 94)
N
162 = 1 x 94 + 68 gcd(94, 68)
94 = 1 x 68 + 26 gcd(68, 26)
68 = 2 x 26 + 16
C gcd(26, 16)
U
26 = 1 x 16 + 10 gcd(16, 10)
AC
16 = 1 x 10 + 6 gcd(10, 6)
10 = 1 x 6 + 4 gcd(6, 4)
6 = 1 x 4 + 2 gcd(4, 2)
4 = 2 x 2 + 0 gcd(2, 0)
08
EXTENDED EUCLID(m, b)
1. (A1, A2, A3)=(1, 0, m);
E3
(B1, B2, B3)=(0, 1, b)
2. if B3 = 0
N
return A3 = gcd(m, b); no inverse
3. if B3 = 1
C
return B3 = gcd(m, b); B2 = b–1 mod m
U
4. Q = A3 / B3
5. (T1, T2, T3)=(A1 – Q B1, A2 – Q B2, A3 – Q B3)
AC
08
Q A1 A2 A3 B1 B2 B3
E3
Q=A3/B3 A1 – Q B1 A2 – Q B2 A3 – Q B3
— 1 0 1759 0 1 550
N
3 0 1 C 550 1 –3 109
U
5 1 –3 109 –5 16 5
AC
21 –5 16 5 106 –339 4
1 106 –339 4 –111 355 1
08
• a set of elements or “numbers” with a binary operator (.) whose result is
always in the set and has the following properties ex G= {Zn ,+} where Zn
E3
is set of all integers mod n
• Closure: if a and b are in set G then c = a . b will always result in value
N
which is in set G
• obeys:
C
• associative law: (a.b).c = a.(b.c) ex (a+b)+c = a+(b+c)
U
• Has identity e: e.a = a.e = a 0+a = a+0 = a
AC
Group 99
08
E3
N
C
U
AC
Ring 100
08
• a set of “numbers”
• with two operations (addition and multiplication) which form:
E3
N
• has closure
• is associative C
U
• is distributive over addition: a(b+c) = ab + ac
AC
08
• with two operations which form:
E3
• abelian group for addition
N
• abelian group for multiplication (ignoring 0) (Identity element in
C
the first operation (+) does not have an inverse in the second
U
operation)
AC
• ring
• have hierarchy with more axioms/laws
• group -> ring -> field
Fields 102
08
Initially (t1=0,t2=1)
t = t1 - q* t2
If r1 = 1 then have
E3
inverse and is
equal to t1
N
C
U
AC
Dr. Abdellatif Elkouny
08
E3
N
C
U
AC
Finite (Galois) Fields 104
08
• finite fields play a key role in cryptography
E3
• can show number of elements in a finite field
must be a power of a prime pn
N
• known as Galois fields
• denoted GF(pn) C
U
AC
08
• GF(p) is the set of integers {0,1, … , p-1} with
E3
arithmetic operations modulo prime p
• these form a finite field
N
• since have multiplicative inverses
C
• find inverse with Extended Euclidean algorithm
U
• hence arithmetic is “well-behaved” and can-do
AC
08
E3
N
C
U
AC
Mod p
p=2
Dr. Abdellatif Elkouny
Modulo 8 107
08
E3
N
C
U
AC
Justification of Galois Field 108
08
• We need to perform +,-,* and /. So we need something that
qualifies for a Field.
E3
• Zp qualifies to be a Field.
• Problems:
N
• If we have 3 bits representation, then we are dealing with Z8
domain. C
U
• For 8 bits representation we have Z256.
AC
• All these are even integer domains and none of them except Z2
are in Zp
• Z8 and Z256 are commutative rings
• Thus, the best solution is to have GF(2n)
Dr. Abdellatif Elkouny
Dr. Abdellatif Elkouny
GF(23) ≈ GF(pn)
109
08
Calculation is a bit deference ex 3 + 5 = 6 not 8 mod 8 =0
E3
a = -a
N
C
U
AC
Modular polynomial Arithmatic 110
08
E3
N
C
U
AC
08
E3
111 = 7 101 = 5 Residual poly max. power =n pn=23
max=3
(prime number) 1011 = (11)dec
N
C
U
010 = 2
AC
110 = 6
08
E3
N
C
U
AC
08
• have considered:
E3
• divisibility & GCD
• modular arithmetic with integers
N
• concept of groups, rings, fields
•
C
Euclid’s algorithm for GCD & Inverse
U
• finite fields GF(p)
AC