Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Module 1 – Introduction to Number Theory

Algebraic Structure
 An arbitrary set with one or more limited operation defined on
it with certain axioms is called algebraic structure.
 3 types of algebraic structure: Groups, Rings, Fields
 Various operations performed on these algebraic structures are
addition, subtraction, multiplication and division operations.
 Each operation takes any two elements from the defined
algebraic structure as input and produces a 3rd element as
output which will also be available in the algebraic structure.
 Example: a and b are 2 input values taken from any algebraic
structure. The input values can be added to produce an output
element c by using commutative law (i.e., a+b = c).
 According to the principles of algebraic structures, the resultant
element c will also be available in the algebraic structure from
where the input values are taken.
 Algebraic structures are used in various cryptography algorithms
to process with integers.
Classification of algebraic structures and the operations supported
by each algebraic structure:

 Group supports addition/subtraction operation or


multiplication/division operation. But it is not supporting both
the addition and multiplication operations.
 There are 2 types of groups used in cryptographic algorithms –
additive group and multiplicative group.
 If the group supports addition operation in the encryption
function and subtraction operation in the decryption function,
then it is called an additive group.
 If the group supports multiplication operation in the encryption
function and division operation in the decryption function, then
it is called a multiplicative group.
 Ring supports addition/subtraction operation and also it
supports the multiplication operation. So, supports 2 operations
at a time.
 Field is a combination of the group and ring and it supports all
the 4 types of binary operations such as addition, subtraction,
multiplication and division operations.

Group
A group contains a set of elements denoted as G together with a
binary operator * on G that satisfies the following axioms:

 The binary operator * can be any operation such as addition,


subtraction, multiplication and division.
 Any group of elements with an operation that satisfies these 4
axioms forms a group.
 Example: set of integers Z forms a group under the addition
operation.
 When addition operation is used in the group, it is called additive
group.
 In additive group, element 0 is an additive identity element and
every integer has an additive inverse.
 For multiplicative group, multiplication operation is used.
 In multiplicative group, element 1 is called as multiplicative
identity element and every integer of that group has a
multiplicative inverse.
 Group is an important algebraic structure used in many
cryptographic algorithms.
 If a developer wants to develop a new encryption function that
uses addition operation, then an additive group can be used for
that encryption function. In the receiver side, subtraction
operation is used in the decryption function.
 If encryption uses multiplication operation in the encryption
function used on the sender side and division operation in the
decryption function used on the receiver side, a multiplicative
group can be used.
 Groups can be divided into 2 types – finite group and infinite
group.
 Finite group – uses finite number of elements and it has a limit.
For example, n where n is a finite number.
 Infinite group – can take infinite number of elements from 0 to
∞.
 Most of the cryptographic algorithms uses finite groups.

Example:
Addition Modulo 10

Example:
Consider the group n, where n=10. Prove that the given group is a
multiplicative group.

3. There exist an identity element 1 ∈ G because


4 xn 1 = 1 xn 4 = 4
Therefore, given group is not a multiplicative group.

Multiplication modulo 10

 In most of the cryptographic algorithms where a multiplication


operation is used in the encryption function, it should generate
multiplicative inverse for all the elements of the group.
 If this condition is not satisfied then the output value produced
by decryption function will not be equal to the input value
supplied to the encryption function.
Example:
Consider that we want to design an encryption and decryption
function to be used in some security-oriented application.
Encryption function: x * y = z
Decryption function: x = z/y
Where, x – plaintext; y – key value selected from the multiplicative
group; z – ciphertext.

Let the multiplicative group be Zn where n = 10. Plaintext x = 8; key


value y = 5;
Encryption: x * y = 8 * 5 = 40 modulo 10 = 0 = z
Decryption: plain text x = z/y = 0/5 = 0 ≠ plaintext.

Decryption function is not producing actual plaintext that is


considered as input in the encryption function.

Reason: The given group is not a multiplicative group. Hence it is not


suitable for cryptographic algorithms where multiplication operation
is used in an encryption function and division operation is used in a
decryption function.

Therefore, additive group is suitable for cryptographic algorithms


where addition operation is used in encryption and subtraction
operation is used in decryption.
Encryption function: x + y = z
Decryption function: x = z - y
Where, x – plaintext; y – key value selected from the additive group; z
– ciphertext.

Let the additive group be Zn where n = 10. Plaintext x = 8; key value y


= 5;
Encryption: x + y = 8 + 5 = 13 modulo 10 = 3 = z
Decryption: plain text x = z-y = 3-5 = -2 mod 10 = 8 = plaintext.

In order to use multiplication operation in the encryption function, we


need to change the group in such a way that all the elements of the
group should produce multiplicative inverse.
Example: if the group Z10 is change to Z7, then all the elements of the
group will produce multiplicative inverse.
Addition modulo 7 and Multiplication modulo 7

Reason: All the elements are relatively prime to the order or size of
the group 7. This type of group is called prime group and is denoted
as Zp.
Prime group is used in many cryptographic algorithms such as Diffie-
Hellman and Elgamal cryptosystem.
Ring:
Field:
Example Problem:
 The field (F) is divided into two types, namely a finite field and
an infinite field.
 Finite field is mainly used in cryptography to design a
computationally efficient algorithm.
 Finite field is also called a Galois field (GF) that has a different
structure than field structure.
 GF is used in many cryptographic algorithms such as advanced
encryption standard (AES) and ellipticcurve cryptography (ECC).
 The order, or number of elements, of a finite field is
represented in the form of (pn), where p is a prime number and
n is a positive integer. For every prime number p and positive
integer n, there exists a finite field with (pn) elements.
 Another notation for a finite field is of the form GF(pn), where
the GF represents a ‘Galois Field’.
 One important issue in the structure (pn) is that arithmetic
operations modulo (pn) do not satisfy all the axioms of a field.
 Consider, for example, p = 2 and n = 6 and then the field will
have the set of integers from 0 to 63.
 Therefore, the field will have 64 integer elements and the order
of the field is 64. Since 64 is not a prime number, the set of
integers is not a field.
 In order to make it to become a field, we have to choose a
closest prime number to the size of field 64. The closest prime
number of the order of the field 64 is 61. However, in this case
the numbers 61,62 and 63 are not used in the field and hence it
is an inefficient way of using a field.
 Therefore, the GF is purely based on polynomial equations.
 To add any two polynomials, the terms must be combined.
o For instance, the addition of two polynomial equations 3x
and 5x can be 8x by adding its terms.
o Likewise, 3x2y and 5x2y can be added to get 8x2y. However,
3x2y and 5x2y3 cannot be added together.
o The reason is that these two terms do not have the exact
variables and the exact powers of those variables.
 The basic definitions used in polynomial equations are given
below:
o Polynomial: A polynomial in x is any expression which can
be written as:

o Degree: The degree of a polynomial is the highest


exponent of the polynomial.
o Monomial: It is a polynomial with one term.
o Binomial: It is a polynomial with two terms.
o Trinomial: It is a polynomial with three terms.
o Like terms: It means the same variable to the same power.
For example, 2x2 and 3x2 are like terms because they have
the same variable raised to the same power. However, 2x2
and 3x3 are not like terms because the powers are
different.

Examples:
 In polynomial division, there are two types of polynomial
division, namely simplification method and real division
method.
o If there is a common factor both in the numerator (top)
and denominator (bottom), then simplification method
is used.
o Otherwise, real polynomial division is used.
o For example, divide the polynomial 2x + 4 by using the
constant polynomial 2. Here, we can use a simplified
method because there is a common factor 2 both in the
numerator and denominator. Therefore,
Galois Fields:
Let’s discuss the way of performing arithmetic operations in the
structure GF(pn).
 The addition and subtraction operations are performed by
adding or subtracting two polynomials together, and reducing
the result modulo the attribute p.
 In a finite field with the attribute p = 2, addition modulo 2 is
performed for addition operation and subtraction modulo 2 is
performed for subtraction operation. This is very identical to
performing XOR operation.
 Therefore, simple XOR operation can be used for performing
addition and subtraction operations when p = 2 in the Galois
field GF(2n).
 For example, addition/subtraction of given two polynomials f(x)
= x2 + 1 and g(x) = x2 + x +1 taken from GF(23) is x.
 Multiplication operation in a Galois field GF(2n) is performed by
multiplication modulo an irreducible reducing polynomial used
to define the Galois field GF(2n).
 During the multiplication operation performed in GF, a
multiplication operation followed by a modulo division
operation is performed using the irreducible polynomial as the
divisor.
 Irreducible polynomial m(x) is a polynomial that has no divisors
other than itself and 1; otherwise, it is called a reducible
polynomial.
 A few examples of some irreducible polynomials are:

 A few examples of reducible polynomials are (x2 ), (x2 + x) , and


(x3 + x2).

NOTE:
 Irreducible polynomial is used in GF(2n) because reducible
polynomials are not generating the multiplicative inverse for the
elements of GF(2n).
 Therefore, it is necessary to choose an irreducible polynomial in
the cryptographic algorithms where multiplication operation is
used in the encryption function and division operation is used in
the decryption function.
Example:
Multiply the given two polynomials f(x) = x2 + x and g(x) = x2 taken from
the Galois field GF(23) for the irreducible polynomial m(x) = x3 + x2 + 1.
The arithmetic operations performed in GF(23) for the irreducible
polynomial m(x) = x3 + x2 + 1 is shown below:

You might also like