Vous êtes sur la page 1sur 19

Abstract Algebra IN Cryptography

Field
A set of elements with two binary operations, called addition and multiplication Obeys: Closure under addition and multiplication Associativity of addition and multiplication Commutativity of addition and multiplication Additive and Multiplicative Identity Distributive laws No Zero divisors Additive and Multiplicative Inverse

Finite Fields
All encryption algorithm, both symmetric and public key, involve arithmetic operations on integers. If one of the operation is division, then we need to work in arithmetic defined over fields. Number of elements in finite fields must be a power of a prime number : pn Also known as Galois Fields Denoted by: GF(pn) In particular often used:
GF(pn) n=1 GF(pn) p=2 & n1

Galois Field (p)


GF(p) is a set of integers {0,1,.p-1} with arithmetic operations modulo prime p Forms a finite field
Since multiplication inverse is defined

We can perform addition, subtraction, multiplication and division without leaving the field GF(p).

Arithmetic Modulo 7
Set of elements {0,1,2,3,4,5,6} Addition:
+ 0 1 0 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 0

2
3 4 5 6

2
3 4 5 6

3
4 5 6 0

4
5 6 0 1

5
6 0 1 2

6
0 1 2 3

0
1 2 3 4

1
2 3 4 5

Additive Inverse Additive Identity Both Additive Identity and Inverse

Contd..
Multiplication:
X 0 1 2 3 4 5 6 0 0 0 0 0 0 0 0 1 0 1 2 3 4 5 6 2 0 2 4 6 1 3 5 3 0 3 6 2 5 1 4 4 0 4 1 5 2 6 3 5 0 5 3 1 6 4 2 6 0 6 5 4 3 2 1

Multiplicative Identity Multiplicative Inverse Both Multiplicative Identity and Inverse

Modulo 8 Addition:
+ 0 1 2 3 4 5 6 7 0 0 1 2 3 4 5 6 7
Additive Inverse Additive Identity Both Additive Identity and Inverse

1 1 2 3 4 5 6 7 0

2 2 3 4 5 6 7 0 1

3 3 4 5 6 7 0 1 2

4 4 5 6 7 0 1 2 3

5 5 6 7 0 1 2 3 4

6 6 7 0 1 2 3 4 5

7 7 0 1 2 3 4 5 6

Modulo 8 Multiplication
X 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 0 1 2 3 4 5 6 7 2 0 2 4 6 0 2 4 6 3 0 3 6 1 4 7 2 5 4 0 4 0 4 0 4 6 4 5 0 5 2 7 4 1 4 3 6 0 6 4 2 0 6 2 2 7 0 7 6 5 4 3 6 1

Multiplicative Identity Multiplicative Inverse Both Multiplicative Identity and Inverse

Observations
Modulo 7 Multiplication inverse is defined for each element of the set.

Modulo 8 Multiplication inverse is defined only for 1,3,5,7

Hence, Arithmetic modulo 7 is a Finite Field where as Arithmetic modulo 8 is not a Finite Field Arithmetic modulo 7 is a Galois Field of type GF(pn) and can be represented as GF(7)
where p is a prime number and n = 1 .

Polynomial Arithmetic
can be computed using polynomials

f(x) = anxn+an-1xn-1+..+a1x+a0 = aixi


Classes of polynomial arithmetic
Ordinary polynomial arithmetic Polynomial arithmetic in which coefficients are in GF(p) Polynomial arithmetic in which coefficients are in GF(p) & polynomials are defined modulo a polynomial m(x) whose highest power is some integer n.

Polynomial Arithmetic with modulo coefficients


Modulo is considered when computing value of each coefficients. could be modulo any prime but we are interested in modulo 2
i.e. coefficients are 0 or 1

Modulo 2 arithmetic
Addition - XOR Multiplication first multiply using ordinary polynomial multiplication then add using addition modulo 2

E.g. let f(x) = x3+x2 and g(x) = x2+x+1


f(x) + g(x) = x3 + x + 1 f(x) + g(x) = x3 + x2 X x2 + x + 1 x3 + x2 x4 + x3 x5 + x4 x5 + x2

Polynomial Division
can write any polynomial in the form:
f(x) = q(x) g(x) + r(x) can interpret r(x) as being a remainder r(x) = f(x) mod g(x)

if have no remainder say g(x) divides f(x) if g(x) has no divisors other than itself & 1 say it is irreducible (or prime) polynomial arithmetic modulo an irreducible polynomial forms a field

Modular Polynomial Arithmetic


Forms a Finite field Coefficients are in GF(p) Polynomials modulo an irreducible polynomial m(x). Uses the set of all polynomials of degree n-1 or less over the field Zp Arithmetic follows the ordinary rules of polynomial arithmetic using the basic rules of algebra, with the following two refinements: Arithmetic on the coefficients is performed modulo p If multiplication results in a polynomial of degree greater than n-1, then the polynomial is reduced modulo some irreducible polynomial m(x) of degree n.

Galois Field GF(2n)


To construct, need to choose a irreducible polynomial m(x) of degree n Polynomials, with coefficients modulo 2 whose degree less than n Must be reduced modulo an irreducible polynomial of degree n ( in multiplication) Can be uniquely represented by n binary bits.

Example: GF(23)

Computational Example
in GF(23) have (x2+1) is 1012 & (x2+x+1) is 1112 so addition is and multiplication is
(x2+1) + (x2+x+1) = x 101 XOR 111 = 0102 (x+1).(x2+1) = x.(x2+1) + 1.(x2+1) = x3+x+x2+1 = x3+x2+x+1 011.101 = (101)<<1 XOR (101)<<0 = 1010 XOR 101 = 11112

polynomial modulo reduction (get q(x) & r(x)) is


(x3+x2+x+1 ) mod (x3+x+1) = 1.(x3+x+1) + (x2) = x2 1111 mod 1011 = 1111 XOR 1011 = 01002

Using Generator
Another way of forming finite fields A generator g of a finite field F of order q is an element whose powers generate all non-zero elements
i.e. {0,g0,g1,g2,,gq-2}

Can create generator from root of the irreducible polynomial Multiplication by adding exponents of generator
gk = gk mod (2^n 1)

Generator for GF(23)


Irreducible polynomial m(x) = x3 + x + 1
+ 000 001 0 1 000 0 0 1 001 1 1 0 010 g1 G g+1 100 g2 g2 g2+1 100 g3 g+1 g 101 g4 g2+g g2+g+1 110 g5 g2+g+1 g2+g 111 g6 g2+1 g2

010
100 011 110 111 101

g1
g2 g3 g4 g5 g6

g
g2 g+1 g2+g g2+g+1 g2+1

g+1
g2+1 g g2+g+1 g2+g g2

0
g2+g 1 g2 g2+1 g2+g+1

g2+g
0 g2+g+1 g g+1 1

1
g2+g+1 0 g2+1 g2 g2+g

g2
g g2+1 0 1 g+1

g2+1
g+1 g2 1 0 g

g2+g+1
1 g2+g g+1 g 0

Vous aimerez peut-être aussi