Docsity

Finite Fields, Inverse - Cryptography and Network Security - Lecture Slides, Slides of Cryptography and System Security

Partial preview of the text

Download Finite Fields, Inverse - Cryptography and Network Security - Lecture Slides and more Slides Cryptography and System Security in PDF only on Docsity!

Cryptography and

Network Security

Chapter 4

Chapter 4 – Finite Fields

The next morning at daybreak, Star flew indoors, seemingly keen for a lesson. I said, "Tap eight." She did a brilliant exhibition, first tapping it in 4, 4, then giving me a hasty glance and doing it in 2, 2, 2, 2, before coming for her nut. It is astonishing that Star learned to count up to 8 with no difficulty, and of her own accord discovered that each number could be given with various different divisions, this leaving no doubt that she was consciously thinking each number. In fact, she did mental arithmetic, although unable, like humans, to name the numbers. But she learned to recognize their spoken names almost immediately and was able to remember the sounds of the names. Star is unique as a wild bird, who of her own free will pursued the science of numbers with keen interest and astonishing intelligence.

— Living with Birds , Len Howard

Group

 a set of elements or “numbers”

 with some operation whose result is also

in the set (closure)

 obeys:

 associative law: (a.b).c = a.(b.c)  has identity e: e.a = a.e = a  has inverses a-1: a.a-1^ = e

 if commutative a.b = b.a

 then forms an abelian group

Cyclic Group

 define exponentiation as repeated

application of operator

 example: a-3^ = a.a.a

 and let identity be: e=a 0

 a group is cyclic if every element is a

power of some fixed element

 ie b = ak^ for some a and every b in group

 a is said to be a generator of the group

Field

 a set of numbers

 with two operations which form:

 abelian group for addition  abelian group for multiplication (ignoring 0)

 ring

 have hierarchy with more axioms/laws

 group -> ring -> field

Modular Arithmetic

 define modulo operator “a mod n” to be

remainder when a is divided by n

 use the term congruence for: a = b mod n

 when divided by n, a & b have same remainder  eg. 100 = 34 mod 11

 b is called a residue of a mod n

 since with integers can always write: a = qn + b  usually chose smallest positive remainder as residue

  • ie. 0 <= b <= n-  process is known as modulo reduction
  • eg. -12 mod 7 = -5 mod 7 = 2 mod 7 = 9 mod 7

Modular Arithmetic Operations

 is 'clock arithmetic'

 uses a finite number of values, and loops

back from either end

 modular arithmetic is when do addition &

multiplication and modulo reduce answer

 can do reduction at any point, ie

 a+b mod n = [a mod n + b mod n] mod n

Modular Arithmetic

 can do modular arithmetic with 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) mod n then b=c mod n  but if (a.b)=(a.c) mod n then b=c mod n only if a is relatively prime to n

Greatest Common Divisor (GCD)

 a common problem in number theory

 GCD (a,b) of a and b is the largest number

that divides evenly into both a and b

 eg GCD(60,24) = 12

 often want no common factors (except 1)

and hence numbers are relatively prime

 eg GCD(8,15) = 1

 hence 8 & 15 are relatively prime

Euclidean Algorithm

 an efficient way to find the GCD(a,b)

 uses theorem that:

 GCD(a,b) = GCD(b, a mod b)

 Euclidean Algorithm to compute GCD(a,b) is:

EUCLID(a,b)

  1. A = a; B = b
  2. if B = 0 return A = gcd(a, b)
  3. R = A mod B
  4. A = B
  5. B = R
  6. goto 2

Galois Fields

 finite fields play a key role in cryptography

 can show number of elements in a finite

field must be a power of a prime p n

 known as Galois fields

 denoted GF(p n^ )

 in particular often use the fields:

 GF(p)  GF(2 n^ )

Galois Fields GF(p)

 GF(p) is the set of integers {0,1, … , p-1}

with arithmetic operations modulo prime p

 these form a finite field

 since have multiplicative inverses

 hence arithmetic is “well-behaved” and

can do addition, subtraction, multiplication,

and division without leaving the field GF(p)

Finding Inverses

EXTENDED EUCLID( m , b )

1. (A1, A2, A3)=(1, 0, m ); (B1, B2, B3)=(0, 1, b ) 2. if B3 = 0 return A3 = gcd( m , b ); no inverse 3. if B3 = 1 return B3 = gcd( m , b ); B2 = b –1^ mod m 4. Q = A3 div B 5. (T1, T2, T3)=(A1 – Q B1, A2 – Q B2, A3 – Q B3) 6. (A1, A2, A3)=(B1, B2, B3) 7. (B1, B2, B3)=(T1, T2, T3) 8. goto 2

Inverse of 550 in GF(1759)

  • Q A1 A2 A3 B1 B2 B
  • — - 3 0 1 550 1 –3 - 5 1 –3 109 –5
  • 21 –5 16 5 106 –339 - 1 106 –339 4 –111