0% found this document useful (0 votes)
11 views8 pages

Unit Iii

The document discusses the mathematics underlying asymmetric key cryptography, focusing on the role of prime numbers, congruence equations, and key concepts such as Fermat's Little Theorem, Euler's totient function, and the Chinese Remainder Theorem. It provides examples and explanations of how to determine primality, calculate multiplicative inverses, and solve quadratic congruences. Additionally, it covers the properties of primitive roots and multiplicative orders relevant to cryptographic applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

Unit Iii

The document discusses the mathematics underlying asymmetric key cryptography, focusing on the role of prime numbers, congruence equations, and key concepts such as Fermat's Little Theorem, Euler's totient function, and the Chinese Remainder Theorem. It provides examples and explanations of how to determine primality, calculate multiplicative inverses, and solve quadratic congruences. Additionally, it covers the properties of primitive roots and multiplicative orders relevant to cryptographic applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

Mathematics of Asymmetric Key Cryptography

Primes and Related Congruence Equations


PRIMES
Asymmetric-key cryptography uses prime numbers extensively.
A prime is divisible only by itself and 1.

Figure Three groups of positive integers


Example 1:
What is the smallest prime?
The smallest prime is 2, which is divisible by 2 (itself) and 1.
Example 2:
List the primes smaller than 10.
There are four primes less than 10: 2, 3, 5, and 7. It is interesting to note that the percentage of primes
in the range 1 to 10 is 40%. The percentage decreases as the range increases.
Cardinality of Primes
We can use infinite Number of Primes.
Number of Primes
π(x) is the number of primes less than or equal to x. π is not similar to mathematics π.
The primes under 25 are 2, 3, 5, 7, 11, 13, 17, 19 and 23 so π(3) = 2, π(10) = 4 and π(25) = 9.

A Table of values of π(x)

Example 1
Find the number of primes less than 1,000,000.
The approximation gives the range 72,383 to 78,543.
The actual number of primes is 78,498.
Checking for Primeness
Given a number n, how can we determine if n is a prime? The answer is that we need to see if the number is
divisible by all primes less than
We know that this method is inefficient, but it is a good start.

Example 1:
Is 97 a prime?
The floor of π(97) = 9. The primes less than 9 are 2, 3, 5, and 7. We need to see if 97 is divisible by any of
these numbers. It is not, so 97 is a prime.
Example 2:
Is 301 a prime?
The floor of π(301) = 17. We need to check 2, 3, 5, 7, 11, 13, and 17. The numbers 2, 3, and 5 do not divide
301, but 7 does. Therefore 301 is not a prime.

Fermat’s Little Theorem


First Version: if p is prime and a is positive integer, then
ap − 1 ≡ 1 mod p
Second Version:
ap ≡ a mod p
This means that if we divide ap by p then the remainder should be ‘a’.

Example
Find the result of 312 mod 11.
Here the exponent (12) and the modulus (11) are not the same. With substitution this can be solved using
Fermat’s little theorem.

Multiplicative Inverses
a−1 mod p = a p − 2 mod p
Example
The answers to multiplicative inverses modulo a prime can be found without using the extended Euclidean
algorithm:

Example:
How to calculate multiplicative inverse of 5 modulo 23 that is 5-1 mod 23?
Solution:
1. 5-1 mod 23 = 523-2 mod 23 (Ref: a-1 mod p= ap-2 mod p)
2. 523-2 mod 23 = 521 mod 23
3. Calculate following to solve 521 mod 23:
51 mod 23 = 5
52 mod 23=25 mod 23=2
54 mod 23= (52)2 mod 23= (2)2 mod 23=4
58 mod 23= (54)2 mod 23 (4)2 mod 23=16
516 mod 23= (58)2 mod 23 (16)2 mod23=256 mod 23=3
Now binary equivalence of 21 is 10101, so multiply 51 , 54 and 516 values, leave 52 and 58 because these are
0’s in binary form.
521 mod 23 = (516 x 54 x 51 ) mod 23=(3x4x5) mod 23=60 mod 23= 14 mod 23.
Finally 5-1 mod 23 = 521 mod 23 = 14 mod 23

Euler's totient function


Euler's totient function, also known as phi-function ϕ(n), this function counts the number of integers that are
both smaller than n and relatively prime to n (coprime). Two numbers are coprime if their greatest
common divisor equals 1.
Here are values of ϕ(n) for the first few positive integers:

Example: Find co-primes of 9?


If we check gcd(9,1), gcd(9,2), gcd(9,4), gcd(9,5), gcd(9,7), gcd(9,8) =1,
So, coprimes to 9 are 1,2,4,5,7,8 and their count ϕ(9)=6
Properties
• ϕ(1)=0
• If p is a prime number, ϕ(p)=p−1
• If a and b are relatively prime, then: ϕ(ab)=ϕ(a)⋅ϕ(b).
• If p is a prime, ϕ(pe)=pe - pe-1
Examples:
1) Find ϕ(7)?
ϕ(7)=7-1=6
2)Find ϕ(21)?
ϕ(21)= ϕ(3x7) = ϕ(3)x ϕ(7)=2x6=12
3)Find ϕ(77)?
ϕ(77)= ϕ(7x11) = ϕ(7)x ϕ(11)=6x10=60

4) Find ϕ(32)?
ϕ(32)= (32)- (32-1) = 9-3=6
5) What is the value of ϕ (13)?
Because 13 is a prime, ϕ (13) = (13 −1) = 12.
6)What is the value of ϕ (10)?
We can use the third rule: ϕ (10) = ϕ (2) × ϕ (5) = 1 × 4 = 4, because 2 and 5 are primes.
7)What is the value of ϕ (240)?
We can write 240 = 24 × 31 × 51. Then
ϕ (240) = (24 −23) × (31 − 30) × (51 − 50) = 64
8)Can we say that ϕ (49) = ϕ (7) × ϕ (7) = 6 × 6 = 36?
No. The third rule applies when m and n are relatively prime. Here 49 = 72. We need to use the fourth rule: ϕ
(49) = 72 − 71 = 42.
9) What is the number of elements in Z14*?
The answer is ϕ (14) = ϕ (7) × ϕ (2) = 6 × 1 = 6. The members are 1, 3, 5, 9, 11, and 13.
Note: Interesting point: If n > 2, the value of f(n) is even.
Euler’s Theorem
First Version:For every a and n, they are relatively prime then
a ϕ(n) ≡ 1 (mod n)
Second Version
a k × f(n) + 1 ≡ a (mod n)
Note: The second version of Euler’s theorem is used in the RSA cryptosystem.

Example :
Find 34 mod 10 ?
Solution

Example 3:
Find the result of 2062 mod 77.
Solution
If we let k = 1 on the second version,
we have f(77)= f(7)x f(11)=6x10=60
2062 mod 77 = (20 mod 77) (2060+1 mod 77) mod 77=
(20 mod 77) (20f(77) + 1 mod 77) mod 77
= (20)(20) mod 77 = 15.
Multiplicative Inverses
Euler’s theorem can be used to find multiplicative inverses modulo a composite.

Example:
The answers to multiplicative inverses modulo a composite can be found without using the extended
Euclidean algorithm if we know the factorization of the composite:

Primitive Root and Multiplicative Orders


Multiplicative Order:
If 'a' and 'n‘ are relatively prime, then
The multiplicative order of ‘a’ modulo n is smallest positive integer 'k' with
ak≡1 (mod n)
The order of modulo ‘n’ is written as ordn(a) or On(a)
Example 1: Define multiplicative order of 4 mod 7
41=4 ≡ 3 (mod 7)
42=16 ≡ 2 (mod 7)
43=64 ≡ 1 (mod 7)
Ord7(4)=3 because 43 is congruent to 1 modulo 7.
Example 2: Define multiplicative order of 2 mod 7
21=2 ≡ 2 (mod 7)
22=4 ≡ 4 (mod 7)
23=8 ≡ 1 (mod 7)
Ord7(2)=3 because 23 is congruent to 1 modulo 7.

Primitive Root :

If the Group G=<Zn*,x> has any primitive root, the number of primitive roots is
ϕ(ϕ (n))
Example: Find the Number of primitive roots of 25
ϕ (25)=20
Find the primitive root of 761
ϕ (ϕ (761))= ϕ (760)
= ϕ (23x5x19) = ϕ (23)x ϕ (5)x ϕ (19)
=(23 - 22)x 4x18=4x4x18
=288
CHINESE REMAINDER THEOREM
The Chinese remainder theorem (CRT) is used to solve a set of congruent equations with one variable but
different moduli, which are relatively prime, as shown below:

Solution To Chinese Remainder Theorem


1. Find M = m1 × m2 × … × mk. This is the common modulus.
2. Find M1 = M/m1, M2 = M/m2, …, Mk = M/mk.
3.Find the multiplicative inverse of M1, M2, …, Mk using the
corresponding moduli (m1, m2, …, mk). Call the inverses
M1−1, M2−1, …, Mk −1.
4. The solution to the simultaneous equations is

Example:
Find the solution to the simultaneous equations:

Solution:
We follow the four steps.
1. M = 3 × 5 × 7 = 105
2. M1 = 105 / 3 = 35, M2 = 105 / 5 = 21, M3 = 105 / 7 = 15
3. The inverses are M −1 −1 −1
1 = 2, M 2 = 1, M 3= 1
4. x = (2 × 35 × 2 + 3 × 21 × 1 + 2 × 15 × 1) mod 105 = 23 mod 105
Example 2:
Find an integer that has a remainder of 3 when divided by 7 and 13, but is divisible by 12.
Solution
This is a CRT problem. We can form three equations and solve them to find the value of x.

If we follow the four steps, we find x = 276. We can check that


276 = 3 mod 7, 276 = 3 mod 13 and 276 is divisible by 12 (the quotient is 23 and the remainder is zero).

Example 3
Assume we need to calculate z = x + y where x = 123 and y = 334, but our system accepts only numbers less
than 100.
Adding each congruence in x with the corresponding congruence in y gives

Now three equations can be solved using the Chinese remainder theorem to find z. One of the acceptable
answers is z = 457.

QUADRATIC CONGRUENCE
Quadratic Congruence is a congruence of the equation of the form a2x2 + a1x + a0 ≡ 0 (mod n).
We limit our discussion to quadratic equations in which
a2 = 1 and a1 = 0, that is equation of the form.
x2 ≡ a (mod n)
There are two ways:
1. Quadratic Congruence Modulo a Prime
2. Quadratic Congruence Modulo a Composite
Quadratic Congruence Modulo a Prime
In this, we consider the modulus is a prime number. That is the form.
x2 ≡ a (mod p)
Where p is a prime and ‘a’ is an integer.
Example 1: Solve the x2 ≡ 3 (mod 11)
Solution: 3 congruent to modulo 11 are 3,14,25 (25 is 5x5 or (-5)x(-5))
The given equation has two solutions:
x2 ≡ 25 (mod 11)
x ≡ 5 (mod 11) and x ≡ -5 (mod 11),
But -5 ≡ 6 (mod 11)
So, the solutions are 5 and 6
Check the result: substitute x=5
52 ≡ 25 =3 (mod 11)
substitute x=6
62 ≡ 36 =3 (mod 11)

Quadratic Congruence Modulo a Composite


Quadratic Congruence Modulo a Composite can be solved by set of Quadratic Congruence Modulo a Prime.
Decomposition of congruence modulo a composite:

Example: Assume that x2 ≡ 36 (mod 77).


We know that 77 = 7 × 11. We can write
The answers are x ≡ +1 (mod 7), x ≡ − 1 (mod 7),
x ≡ + 5 (mod 11), and x ≡ − 5 (mod 11). Now we can make four sets of equations out of these:

The answers are x = ± 6 and ± 27.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy