0% found this document useful (0 votes)
6 views

Lec-7 Number Theory and Algebraic Structures

Uploaded by

charvipm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lec-7 Number Theory and Algebraic Structures

Uploaded by

charvipm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Cryptography

Lec. 7
Number Theory & Algebriac
Structure
Modular Arithmetic
• Modulo Operator

The modulo operator (mod) takes an integer (a) from


the set Z and a positive modulus (n). The operator
creates a nonnegative residue (r).
a mod n = r
Modular Arithmetic
Example:

a. 27 mod 5
Dividing 27 by 5 results in r = 2. This means that 27 mod 5 = 2.

b. -7 mod 10
Dividing −7 by 10 results in r = −7. After adding the modulus to −7, we have
r = 3. This means that −7 mod 10 = 3.
.𝑎 ≡ 𝑎(𝑚𝑜𝑑𝑛)
Algorithm
(a and p are relatively prime)

1st Version (a and p are relatively prime)

2nd Version (a and p are not relatively prime)

Example
1.

2.
1st Version (a and n are relatively prime)

2nd Version (a and n are not relatively prime)

Example
Inverse Modulo
When we are working in modular arithmetic, we often need to find
the inverse of a number relative to an operation. We are normally
looking for an additive inverse (relative to an addition operation) or a
multiplicative inverse (relative to a multiplication operation).
Inverse Modulo

Example
Extended Euclidean Algorithm
The extended Euclidean algorithm we discussed earlier can find
the multiplicative inverse of b in 𝑍𝑛 when n and b are given and
the inverse exists. To show this, let us replace the first integer a
with n (the modulus). We can say that the algorithm can find s
and t such s × n + b × t = gcd (n, b). However, if the multiplicative
inverse of b exists, gcd (n, b) must be 1. So the relationship is
Extended Euclidean Algorithm
Extended Euclidean Algorithm
Algorithm
Extended Euclidean Algorithm
Example
Discrete Logarithms
• Order of an element: The order of an element, a(a and n
are relatively prime), is the smallest integer i, such that
𝑎𝑖 ≡ 1 𝑚𝑜𝑑 𝑛 .
Where i is known as the order of mod n
It is represented as 𝑜𝑟𝑑𝑛 𝑎.
• Euler’s Theorem:
This theorem is very helpful because it shows that the
relationship 𝑎𝑖 ≡ 1 𝑚𝑜𝑑 𝑛 holds when i = ∅(n), even if it holds
when i < ∅(n). In other words, this relation holds at least once.
• Primitive Roots: the order of an element is the same as ∅(n),
that element is called the primitive root of the group.
In other words, ∅(n) = 𝑜𝑟𝑑𝑛 𝑎,
a is known as the primitive root of n
Discrete Logarithms
Discrete Logarithms
Discrete Logarithms
• For an integer b with primitive root as a of a prime number p, we can
find a unique exponent i such that
b ≡ 𝒂𝒊 𝒎𝒐𝒅 𝒑
i is known as the discrete log of b for the base of a mod n

• represented as 𝑑𝑙𝑜𝑔𝑎,𝑝 (𝑏)


Discrete Log Problem
Algebriac Structure
• Cryptography requires sets of integers
and specific operations that are
defined for those sets.
• The combination of the set and the
operations that are applied to the
elements of the set is called an
Algebraic Structure.
Algebriac Structure
• There are three common algebraic
structures: groups, rings, and fields
Groups
Groups
Groups
Groups
• Example
Rings
Rings
• Example:
Fields
Finite Fields

Types:

1) Prime Fields(n=1)
2) Extension Fields(n>1)
GF(2n) Fields
Finite fields are important in cryptography. A
number of cryptographic algorithms rely
heavily on properties of finite fields, notably
the Advanced Encryption Standard (AES) and
elliptic curve cryptography.
Prime {GF(p)} Fields

Additive Multiplicative
Extension{GF(𝑃 )} Fields
𝑛

• Represented as 𝑃𝑛
• In AES, the underlying mathematical
structure relies on finite fields,
specifically the finite field GF(2^8), also
known as the Galois Field with 2^8
elements.
Extension{GF(𝑃 )} Fields
𝑛

In extension fields, particularly in the


context of finite fields, the arithmetic
operations are not performed using
traditional modulo arithmetic as in integers.
Instead, the operations are carried out using
polynomial coefficients representation.
Extension{GF(𝑃 )} Fields
𝑛

Traditional Modulo Arithmetic:


•In standard modulo arithmetic, you perform
operations with respect to a modulus. For
example, in integers modulo 7:
• 5+4≡2(mod7)
• 6×3≡3(mod7)
Extension{GF(𝑃 )} Fields
𝑛

Coefficients Representation:
Extension fields, such as GF(2^n), involve
polynomials over a base field (e.g., GF(2)).
Elements in the extension field are
represented as polynomials of degree n−1
with coefficients from the base field.
Extension{GF(𝑃 )} Fields
𝑛

You might also like