Vous êtes sur la page 1sur 8

BASIC NUMBER THEORY

In modern cryptographic system, the messages are represented by numerical values prior to being
encrypted and transmitted. The encryption process r mathematical operations that turn the input
numerical values into output numerical values.
Mathematical tools are required for building, analyzing and attacking the cryptosystem. Number theory
is concerned with the property of the integers.
DIVISIBILITY
Definition: given two integers a and b, v say a divides b if there is an integer c such that b=ac,if a divides
b we write as a|b.
For eg:7/63 because 7*9=63
A consequence of this definition is that every number divides zero. if a divide b then it is the multiple of
a.
The following statements are divisibility hold
1. if a|b then a|bc for all c
2. if a|b then b|c for all a|c
3. if a|b and a|c then a|sb+tc for all s and t.
4. for all c=0,a|b if and only if ca|cb.
GREATEST COMMON DIVISOR
1. DEFINITION:A positive integer d is called as the greatest common divisor of the non integer
a and b if
D is the divisor of both a and b
Any divisor of both a and b is also a divisor of d
2. We will use the notification gcd(a,b) or for the greatest common divisor a and b.
3. Greatest common divisor a and b is the largest number that divides a and b.
4. If a and b shares no common factors they are called as relatively prime.
For eg find gcd (1403,1081)
1403=1081.1+322
1081=322.3+115
322=115.2+92
115=92.1+23
92=23.4+0
The largest non zero remainder is 23 so gcd =23
It is always possible to write the gcd (a,b) as the linear combination of a and b. that is there exists
integer x and y such that gcd (a,b) =ax+by.
How to find the gcd (a,b)?
For eg:
1180=2*482+216
482=2.216+50
213=4*50+16
50=3*16+2
16=8*2+0

In general
A=q1*b+r1
B=q2*r1+r2
R1=q3*r2+r3
.
.
.
.
.
Rk-2=qk.rk-1+rk
Rk-1=qk+1.rk+0
Then gcd(a,b)=rk



Modular arithmetic
Much of modern number theory and many practical problems are concerned with modular
arithmetic. In modular arithmetic we are concerned with the arithmetic on integers, where we
identify all the integers which differ by the multiple of N. that is,
X=y mod n if x=y+mN
This identification divides all the into n equivalence classes, we denote this by their simplest
members that is the numbers 0,1,N-1.if a integer and n is the positive integer define mod n to
be the remainder
Example 11 mod 7=4;-11 and 7=3


Theorem:
N is an equivalence relation on the integers. An equivalence class consists of those integers which
have the same remainder on division by n. the equivalence classes are also known as congruence
classes modulo n . Rather than say that integer a and b are equivalence we say they are
congruent modulo n.
Definition:
The set of all integers congruent to the modulo n is called as the residue class[a]
Example:
[0]=[,-6,-3,0,3,6]
[0]=[,-5,-2,1,4,7]
[0]=[,-4,-1,2,5,8,6]
The modulo operator has following operations
A=b mod n if n|(a-b)
(a mod n)=(b mod n)implies a=b mod n
A =b mod n implies b=a mod n
A=b mod n and b=c mod n implies a=c mod n
Properties of modular arithmetic operations
[(a mod n)+(b mod n)]modN=(a+b)mod n
[(a mod n)-(b mod n)]modN=(a-b)mod n
[(a mod n)*(b mod n)]modN=(a*b)mod n
Proof of property1:
Define (a mod n)=ra and (b mod n)=rb. Then a =ra+jn and b=rb+kn for some integers j and k. then ,
(a+b mod n)=( ra+jn+ rb+kn)mod n
=( ra+jn+ (j+k)n)mod n
=(ra +rb)mod n
=[(a mod n)*(b mod n)]modN=(a*b)mod n
Commutative law (w+x)mod n=(x+w)mod n
Assosiative law (w*x)mod n=(x*w)mod n
Distributive law [w*(x*y)]mod n=[(w*x)*y)]mod n
identities [w*(x+y)]mod n=[w*x+w*y)]mod n
Additive inverse(-w) (l*w)mod n=w mod n

If n is the prime number then the property of inverse holds
The following table provides modular addition and multiplication of modulo 7
+ 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 2 4
6 6 0 1 2 3 4 5




The following table shows the multiplication of modulo 7

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


Additive and multiplicative of inverse modulo7
w -w W^-1
0 0 -
1 5 1
2 4 4
3 3 5
4 2 2
5 1 3


MODULAR EXPONENTIAL
Modular exponential is a type of exponential performed over a modulus doing a modular
exponential means calculating the remainder when dividing by a positive integer
m(called the modulus)a positive integer b (called the base) raised to the eth power(e is
the exponent)
In other words the problem take the form where the given base b, exponent e, and
modulus m one wishes to calculate c.
Many public key encryption algorithm are used for modular exponential raising the
number a base to some power b (exponent)mod p.
C=ab=a*a..a modp.

SOLVING ax+by=d
One of the consequences of the Euclidean algorithm is as follows:
The integral solution to the equation ax+by=gcd(a,b)
furthermore the extended theorem can be used to find the values of x and y to stisfy the
given equation
the algorithm will look similar to the proof in some manner
consider writing down the steps in the Euclid algorithm
A=q1*b+r1
B=q2*r1+r2
R1=q3*r2+r3
.
.
.
.
.
Rk-2=qk.rk-1+rk
Rk-1=qk+1.rk where 0<rk<rk-1
Consider solving the second last equation of rk,you get
rk = Rk-2-qk.rk-1+rk
gcd(a,b)= Rk-2-qk.rk-1
now solve the previos equation for rk-1
gcd(a,b)= Rk-2-qk(rk-3-qk-1rk-2)
gcd(a,b)= (1+qkqk-1)rk-2-qkrk-3
now we have expressed the expected gcd of ab as a linear combination of rk-2 and rk-3. Next we can
substitute the values for rk-2 in terms of rk-3and rk-4 so that the gcd(a,b)can be expressed in the terms
of that. By continuing the process the linear combination of a and b as desired.

Find the integers x and y such that: 135x+50y=5
Use euclic algorithm to compute gcd(135,50):
135=2*50+35
50=1*35+15
35=2*15+5
15=3*5

Now let us use the extended euclid algorithm to solve the problem
5=35-2*15, from second to last equation 35=2*15+5
But we have
15=50-35 from the third to last equation 50=1*35+15
Now substitute the value in the derived equation
5=35-2*(50-35)
5=3*35-2*50
Now finally use the first equation to deyetminr the expression for 35 as a linear combination of 135 and
50
35=135-2*50
Plug this into our last equation
5=3*(135-2*50)-2*50
5=3*135-8*50
So a set of solution to the equation x=3; y=-8.

Congruences
definition: let a, b, m be the integers with m>=1.then a is a congruent to b modulo m |(a-b). in such case
we write a=b (mod m)
for eg:15=4 mod9
THEOREM 1:
Suppose that a , m are integers with m>=1 then the unique integers r with
0<r<m
A=r (mod m)
This is the division theorem in disguise
Then a-r= qm so that m|(a-r)
THEOREM2:
Suppose that a ,m are integers with m>=1 then
A=A (mod m)
A=B (mod m)=> B=A(mod m)
LINEAR CONGRUENCE
Given integers a, m are integers with m>=1, solve the congruence ax=b(mod m) means find all the
integers x which satisfy the congruence.
If these are the solutions, then we can express the answer as x=c(mod m) or as x=c+Mt. where m will
emerge from the calculation. It is always a divisor of m.
3x=4(mod 5)
3x=9(mod5)
X=3(mod5) as gcd (5,3)=1
CHINESE REMAINDER THEOREM
Suppose the gcd(m,n)=1 given a and b there exist exactly one solution x(mod mn) to the simultaneous
congruence under certain conditions
X=a(mod m),x=b(mod n)
Proof:
there exists integer s,t such that ms+nt=1. Then ms=1(mod n) and nt=1(mod m).let x=bms+ant.
Then
x=ant=a(mod m) and x=bms=b(mod n) as desired
suppose x1 is the another solution x=x1(mod m) and x=x1(mod n) so it is the multiple of both m
and n

LEMMA:
Suppose m and n are the integers with gcd(m,n)=1. If integer c is multiplied to both m and n then
c is the multiple of mn.
Proof:
Let c=mk=nl.write ms+nt=1 with the integers s,t. multiply c to both
c=cms+cnt=mnls+mnkt=mn(ls+kt)
To finish the proof of the theorem lrt x=x-x1 in the lemma to find it is the multiple of m.
Therefore x=x1(mod mn).
This means any two solution x to the system of congruence are congruent mod mn as claimed.

EXAMPLE:
SOLVE X=3(M0D 7);X=5(MOD 15)

Solution:
X=80(mod 105)
Since 80=3(mod 7)
And 80=5(MOD 15)
80 is the solution.
The theorem guarantees that such a solution exists and says that it is uniquely determined mod
the product of mn which is 150 in the present example.

Vous aimerez peut-être aussi