Security Lec4
Security Lec4
Public Cryptography
Galois Field
• Finite Field:
Field A field with finite number of elements, also
known as Galois Field.
• The number of elements is always a power n of a prime
number p. Hence, denoted as GF(pn).
• GF(p) ≡ Zp is the set of integers {0,1, … , p-1} with arithmetic
operations modulo prime p .
Example(1.1) :
GF(2) = { 0 , 1 }
GF(6)
GF(8)= { 0, 1,2,3,4,5,6,7}
GF(9)= { 0, 1,2,3,4,5,6,7,8}
Évariste Galois
25 October 1811 – 31 May 1832
GF(12)= { 0,1,2,3,4,5,6,7,8,9,10,11}
Galois Field
• Field elements in GF(2m) can be represented in several ways
including:
• Polynomial: x3 + x2 +1 = 1 x3 + 1 x2 + 0 x + 1
• Binary: (1101)2
• Integer: (13)10
GF(8)= { 0, 1,2,3,4,5,6,7} Integer
GF(8)= {000,001,010,011,100,101,110,111} Binary
GF(8)={0 ,1 ,x ,x+1 ,x2 ,x2+1 ,x2+x , x2+x+1} Polynomial
GF(9)= { 0, 1,2,3,4,5,6,7,8}
GF(9)= {00,01,02,10,11,12,20,21,22}
GF(9)={0 ,1 ,2 ,x ,x+1,x+2,2x, 2x+1,2x+2}
f(x)= 8 x4 -3 x3+ 5 x2 -7 x+ 2
Operations on Polynomials of GF
1) The polynomial arithmetic operation of GF(pm) on GF(p) with
mod p coefficients.
2) The polynomial arithmetic operation of GF(pm) on GF(p) with
coefficients on mod (p) or Zp , and the operation on mod(m(x)).
The operations are:
Add, subtract, multiply, divide polynomials, and remainders.
Example(1.2):
1) let f(x)=2x4+x2+6x , g(x)=4x+5 on GF(7),
2) Let f(x)=x5+x+1 , g(x)=x+1 on GF(2),
3) let f(x)=x5+x3+x+1 , g(x)=x2+x+1 on GF(27), where m(x)=x7+x+1,
Find f(x)+g(x) , f(x)-g(x) , f(x) g(x)?
f(x)+g(x)
1) (2x4+x2+6x) + (4x+5) =2x4+x2+3x+5 mod(7)
2) (x5+x+1) + (x+1) =x5 mod(2)
3) (x5+x3+x2+1) + (x2+x+1) = x5+x3+x mod(x7+x+1)
f(x)-g(x)
1) (2x4+x2+6x) - (4x+5)= (2x4+x2+6x) + (3x+2)
=2x4+x2+2x+2 mod(7)
2) (x5+x+1) - (x+1) = (x5+x+1) +(x+1)= x5 mod(2)
3) (x5+x3+x2+1) - (x2+x+1) = (x5+x3+x2+1) +(x2+x+1)
= x5+x3+x mod(x7+x+1)
2x 4+x2+6x
24 mod 7=3
4x+5
-------------
10 mod 7=3
3x 4+5x2+2x
8 mod 7=1
x +4x +3x
8 mod 7=1 5 3 2
--------------
x
(2x4+x2+6x) (4x+5) mod (7)= 5+3x4+4x3+x2+2x
x 6+x2+x
--------------
x
(x5+x+1) (x+1) mod (2)= 6+x5+x2+1
Multiplication
2) f(x) g(x) = (x5+x+1) (x+1) mod (2)
100011
11
-------------
Other
100011
Method
1000110
--------------
1100101
1x6+1x5+0x4+0x3+1x2+0x+1
(x5+x+1) (x+1) mod (2)= x6+x5+x2+1
Multiplication
3) f(x) g(x) = (x5+x3+x+1) (x2+x+1) mod m(x)
where m(x)=x +x+1 7
1) m(x) mod m(x)≡0
Example(1.3) :
x2+x+1 mod (x2+x+1)=0
2)
then
Example(1.4) :
x7 mod (x7+x+1)=x+1
x5 mod (x5+x3+x+1)= x3+x+1
Multiplication
3) f(x) g(x) = (x5+x3+x+1) (x2+x+1) mod m(x)
where m(x)=x7+x+1
The degree of m(x) is 7
(x5+x3+x+1) (x2+x+1)=x7+x6+x4+1 =x+1+x6+x4+1= x6+x4+x
The degree m(x) equal 7
H.W(6)Galois Field
Since : Calculate x5 mod (x3+x+1) on GF(23)?
x7≡x+1
H.W(7)Galois Field:Calculate (x2+x) (x3+x2+1)mod (x4+x3+1) on GF(24)?
H.W(1) DP.: Show that g(x)= x4+x3+x2+x+1 is divisor of f(x)=x5+1?
Irreducible polynomial
The polynomials are reducible polynomial is have zeros,
otherwise are irreducible polynomial .
f(x) =x2+x+1 irreducible
f(x) =1+x+x3+x4 = (1+x)(1+x3) reducible
f(x) =x+x3+x7 = x (1+x2+x6) reducible
f(x) = 1+x+x4 irreducible
f(x) = x+x2+x3+x5= x (1+x+x2+x4) reducible
H.W(1) PrimPoly: is x3+x+1 reducible or irreducible ?
(x2+x+1)-1= (x3+x2+x)
Inverse element in GF(Pn)
Find inverse of x2+x+1 under GF(24), module m(x)=x4+x3+1?
0 α7 α2+α+1
- 1 α8 α3+α2+α
α α α9 α2+1
α2 α2 α10 α3+α
α3 α3 α11 α3+α2+1
α4 α3+1 α12 α+1
α5 α3+α+1 α13 α2+α
α6 α3+α2+α+1 α14 α3+α2
Inverse element in GF(Pn)
Find inverse of x2+x+1 under GF(24), module m(x)=x4+x3+1?
0 α7 α2+α+1 α15= α7 α8
- 1 α8 α3+α2+α
α α α9 α2+1
α2 α2 α10 α3+α
α3 α3 α11 α3+α2+1
α4 α3+1 α12 α+1
α5 α3+α+1 α13 α2+α
α6 α3+α2+α+1 α14 α3+α2
Inverse element in GF(Pn)
Find inverse of x2+x+1 under GF(24), module m(x)=x4+x3+1?
0 α7 α2+α+1 α15= α7 α8
- 1 α8 α3+α2+α
α α α9 α2+1
α2 α2 α10 α3+α
α3 α3 α11 α3+α2+1
α4 α3+1 α12 α+1
α5 α3+α+1 α13 α2+α
α6 α3+α2+α+1 α14 α3+α2
(x2+x+1)-1= (x3+x2+x)
Goppa Code
Let a Goppa polynomial be defined as a polynomial over GF(ᵅ ᵅ ),
that is,
Example(3.1):
Suppose GF(24)={0,1,α, α2, α3, α4,…, α14} on primitive polynomial m(x)=x4+x+1,let
the Goppa polynomial of degree 2 ( t=2) is 0 α7 α3+α+1
- 1 α8 α2+1
g(x) = (x + α)(x +α14)= x2+ α7 x+1 on GF(24)
α α α9 α3+α
x 2+αx+ α14x+α15 m=4, p=2, α 2
t=2,
α 2
n=12
α 10 α2+α+1
g(x)≠0 x≠α , x≠α 14
The coefficients of g(x) belong
x2+(α+ to•15the
α14)x+α GF dimension k of Γ(L, g(x)) must
4) x2+(α+ α3+1) x+1 α α
3 3 α 11 α +α +α
3 2
(2
L={ α | 2 ≤ i ≤ 13 } x2+(α3+α+1) x+1
i be at least k≥n-mt=12- 2*4=4
x +α x+1
2 7 • The minimum
α4 α+1 distance
α12 of the
α3+α 2+α+1
h1 = g(α2)-1 = (α4 + α9 +1 )-1 = ( (1 1 0 0)T + (0 1 0 1)T + (1 0 0 0)T )-1 =
( ( 0 0 0 1)T )-1 = (α3 )-1 = α12.
h2 = g(α3)-1 = (α6 + α10 +1 )-1 = ( (0 0 1 1)T + (1 1 1 0)T + (1 0 0 0)T )-1 =
( ( 0 1 0 1)T)-1 = (α9 )-1 = α6.
h3 = g(α4)-1 = (α8 + α11 +1 )-1 = ( (1 0 1 0)T + (0 1 1 1)T + (1 0 0 0)T )-1 =
( ( 0 1 0 1)T)-1 = (α9 )-1 = α6.
h4 = g(α5)-1 = (α10 + α12 +1 )-1 = ( (1 1 1 0)T + (1 1 1 1)T + (1 0 0 0)T )-1 =
( ( 1 0 0 1)T)-1 = (α14 )-1 = α.
h5 = g(α6)-1 = (α12 + α13 +1 )-1 = ( (1 1 1 1)T + (1 0 1 1)T + (1 0 0 0)T )-1 =
( ( 1 1 0 0)T)-1 = (α4 )-1 = α11.
h6 = g(α7)-1 = (α14 + α14 +1 )-1 = (1)-1 =( ( 1 0 0 0)T)-1 = 1.
h7 = g(α8)-1 = (α16 + α15 +1 )-1 = (α + 1 +1 )-1 = (α)-1 = α14.
h8 = g(α9)-1 = (α18 + α16 +1 )-1 = (α3 + α +1 )-1 = (α7 )-1 = α8
h9 = g(α10)-1 = (α20 + α17 +1 )-1 = (α5 + α2 +1 )-1 =
( (0 1 1 0)T + (0 0 1 0)T + (1 0 0 0)T )-1 =( ( 1 1 0 0)T )-1 = (α4 )-1 = α11.
h10 = g(α11)-1 = (α22 + α18 +1 )-1 = (α7 + α3 +1 )-1 =
( (1 1 0 1)T + (0 0 0 1)T + (1 0 0 0)T )-1 =( ( 0 1 0 0)T )-1 = (α )-1 = α14.
h11 = g(α12)-1 = (α24 + α19 +1 )-1 = (α9 + α4 +1 )-1 =
( (0 1 0 1)T + (1 1 0 0)T + (1 0 0 0)T )-1 =( ( 0 0 0 1)T )-1 = (α3)-1 = α12.
h12 = g(α13)-1 = (α26 + α20 +1 )-1 = (α11 + α5 +1 )-1 =
( (0 1 1 1)T + (0 1 1 0)T + (1 0 0 0)T )-1 =( ( 1 0 0 1)T )-1 = (α14 )-1 = α.
since
The generator matrix G can be computed from H by using GHT = 0, so the
vectors in the nullspace of H modulo 2 form the rowspace of G. In this case, G
is as follow:
H.W (1) Goppa matrix:
Calculate Goppa matrix of Goppa code g(x)=x2-1, on GF(24) under module
primitive polynomial m(x)=x4+x+1 ,
with p=2, m=4, t=2, and n=9, where L={ αi | 1≤i≤9} ?
Robert J. McEliece
(May 21, 1942 – May 8, 2019)
In order to construct the public and private keys, Bob
must first choose an arbitrary Goppa polynomial ᵅ (x)
with a degree ᵆ over ᵃ F(2ᵅ ).
The Goppa code defined by this polynomial and by ᵃ
has parameters [ᵅ , ≥ ᵅ − ᵅ t, ≥ 2ᵆ + 1].
• Bob receives Alice’s codeword and uses his permutation
matrix ᵄ to compute
ᵆ ′ = ᵆᵄ −1 = ᵅᵃ ′ᵄ −1 + ᵅᵄ −1 = ᵅ SGᵄᵄ −1 + ᵅ ′ = (ᵅ S)ᵃ + ᵅ ′.
• Bob can then decode ᵆ ′ into the message ᵅ ′ = ᵅ S by
finding ᵅ ′, which is done by Bob applying
Patterson’s algorithm. Once this is done, Bob can is
calculate ᵆ − ᵅ ′=ᵅ SG and since Bob knows what ᵄ is, he
can calculate ᵄ −1, and then recover the original message
ᵅ =ᵅ ′ᵄ −1.