Abstract Algebra In Cryptography

download Abstract Algebra In Cryptography

of 19

Transcript of Abstract Algebra In Cryptography

  • 7/31/2019 Abstract Algebra In Cryptography

    1/19

    Abstract AlgebraIN

    Cryptography

  • 7/31/2019 Abstract Algebra In Cryptography

    2/19

    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

  • 7/31/2019 Abstract Algebra In Cryptography

    3/19

    Finite Fields

    All encryption algorithm, both symmetric and publickey, involve arithmetic operations on integers.

    If one of the operation is division, then we need towork in arithmetic defined over fields.

    Number of elements in finite fields must be a power ofa 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

  • 7/31/2019 Abstract Algebra In Cryptography

    4/19

    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).

  • 7/31/2019 Abstract Algebra In Cryptography

    5/19

    Arithmetic Modulo 7

    Set of elements {0,1,2,3,4,5,6}

    Addition:

    + 0 1 2 3 4 5 6

    0 0 1 2 3 4 5 6

    1 1 2 3 4 5 6 0

    2 2 3 4 5 6 0 1

    3 3 4 5 6 0 1 2

    4 4 5 6 0 1 2 3

    5 5 6 0 1 2 3 4

    6 6 0 1 2 3 4 5

    Additive Identity

    Additive Inverse

    Both Additive Identity and Inverse

  • 7/31/2019 Abstract Algebra In Cryptography

    6/19

    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 26 0 6 5 4 3 2 1

    Both Multiplicative Identity and Inverse

    Multiplicative Inverse

    Multiplicative Identity

  • 7/31/2019 Abstract Algebra In Cryptography

    7/19

    Modulo 8 Addition:

    + 0 1 2 3 4 5 6 7

    0 0 1 2 3 4 5 6 7

    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

    Additive Identity

    Additive Inverse

    Both Additive Identity and Inverse

  • 7/31/2019 Abstract Algebra In Cryptography

    8/19

    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 0 4

    5 0 5 2 7 4 1 6 3

    6 0 6 4 2 6 4 2 6

    7 0 7 6 5 4 3 2 1

    Both Multiplicative Identity and Inverse

    Multiplicative Inverse

    Multiplicative Identity

  • 7/31/2019 Abstract Algebra In Cryptography

    9/19

    Observations

    Modulo 7-

    Multiplication inverse is defined for each element ofthe set.

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

    Hence, Arithmetic modulo 7 is a Finite Fieldwhere as Arithmetic modulo 8 is not a Finite Field

    Arithmetic modulo 7 is a Galois Field of typeGF(pn) and can be represented as GF(7)

    where p is a prime number and n = 1 .

  • 7/31/2019 Abstract Algebra In Cryptography

    10/19

    Polynomial Arithmetic

    can be computed using polynomials

    f(x) = anxn+an-1x

    n-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.

  • 7/31/2019 Abstract Algebra In Cryptography

    11/19

    Polynomial Arithmetic with modulo

    coefficients

    Modulo is considered when computing value ofeach 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 ordinarypolynomial multiplication then add using additionmodulo 2

  • 7/31/2019 Abstract Algebra In Cryptography

    12/19

    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

  • 7/31/2019 Abstract Algebra In Cryptography

    13/19

    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)

    ifg(x) has no divisors other than itself & 1 say

    it is irreducible (or prime) polynomial arithmetic modulo an irreducible polynomial

    forms a field

  • 7/31/2019 Abstract Algebra In Cryptography

    14/19

    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 thefollowing two refinements:

    Arithmetic on the coefficients is performed modulo p

    If multiplication results in a polynomial of degreegreater than n-1, then the polynomial is reducedmodulo some irreducible polynomial m(x) of degree n.

  • 7/31/2019 Abstract Algebra In Cryptography

    15/19

    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.

  • 7/31/2019 Abstract Algebra In Cryptography

    16/19

    Example: GF(23)

  • 7/31/2019 Abstract Algebra In Cryptography

    17/19

    Computational Example

    in GF(23) have (x2+1) is 1012 & (x2+x+1) is 1112

    so addition is (x2+1) + (x2+x+1) = x

    101 XOR 111 = 0102

    and multiplication is (x+1).(x2+1) = x.(x2+1) + 1.(x2+1)

    = x3+x+x2+1 = x3+x2+x+1

    011.101 = (101)

  • 7/31/2019 Abstract Algebra In Cryptography

    18/19

  • 7/31/2019 Abstract Algebra In Cryptography

    19/19

    Generator for GF(23)

    Irreducible polynomial m(x) = x3 + x + 1

    + 000 001 010 100 100 101 110 111

    0 1 g1 g2 g3 g4 g5 g6

    000 0 0 1 G g2 g+1 g2+g g2+g+1 g2+1

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

    010 g1 g g+1 0 g2+g 1 g2 g2+1 g2+g+1

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

    011 g3 g+1 g 1 g2+g+1 0 g2+1 g2 g2+g

    110 g4 g2+g g2+g+1 g2 g g2+1 0 1 g+1

    111 g5 g2+g+1 g2+g g2+1 g+1 g2 1 0 g

    101 g6 g2+1 g2 g2+g+1 1 g2+g g+1 g 0