Number Theory and Cryptography
The part of mathematics devoted to the study of the set of integers and their properties is known as number theory.
Divisibility and Modular Arithmetic
Division of an integer by a positive integer produces a quotient and a remainder.
Division
- Definition :
If
and are integers with , we say that divides if there is an integer such that (or equivalently, if is an integer). When divides we say that is a factor or divisor of , and that is a multiple of . The notation denotes that divides . We write when does not divide . - Theorem :
Let
and be integers, where . Then (I) if and , then ; (II) if , then for all integers ; (III) if and , then .
The Division Algorithm
- THE DIVISION ALGORITHM :
Let
be an integer and a positive integer. Then there are unique integers and , with such that .
In the equality given in the division algorithm,
div mod .
Modular Arithmetic
- Definition :
If
and are integers and is a positive integer, then is congruent to modulo if divides . We use the notation (mod ) to indicate that is congruent to modulo m. We say that (mod ) is a congruence and that is its modulus (plural moduli). If and are not congruent modulo , we write (mod ). - Theorem :
Let
and be integers, and let be a positive integer. Then (mod ) if and only if mod mod .
The great German mathematician Karl F. Gauss developed the concept of congruences at the end of the eighteenth century. The notion of congruences has played an important role in the development of number theory.
- Theorem :
Let
be a positive integer. The integers and are congruent modulo if and only if there is an integer such that .
The set of all integers congruent to an integer
- Theorem :
Let
be a positive integer. If (mod ) and (mod ), then (mod ) and (mod ). - Corollary :
Let
be a positive integer and let and be integers. Then
Arithmetic Modulo
We can define arithmetic operations on
Integer Representations and Algorithms
Representations of Integers
In everyday life we use decimal notation to express integers. In decimal notation, an integer
- Theorem (Base
expansion of ) : Let be an integer greater than 1. Then if is a positive integer, it can be expressed uniquely in the form where is a non-negative integer, are non-negative integers less than , and .
Base Conversion
First, divide
- Algorithm : Constructing Base
Expansions procedure base expansion( : positive integers with ) while mod div return ( ) { is the expansion of }
Algorithms for Integer Operations
The algorithms for performing operations with integers using their binary expansions are extremely important in computer arithmetic.
Addition Algorithm
- Algorithm : Addition of Integers.
procedure add(
: positive integers) { and are and respectively} for to return {the binary expansion of the sum is }
Multiplication Algorithm
- Algorithm : Multiplication of Integers.
procedure multiply(
: positive integers) { and are and respectively} for to if then shifted places else are partial products for to return { is the value of }
Algorithm for and
- Algorithm : Computing div and mod.
procedure division algorithm(
: integer, : positive integer) while if and then return { is the quotient, is the remainder}
Modular Exponentiation
In cryptography it is important to be able to find
- Algorithm : Fast Modular Exponentiation.
procedure modular exponentiation(
: integer, : positive integers) mod for to if then mod mod return { equals mod }
Primes and Greatest Common Divisors
Primes have become essential in modern cryptographic systems, and we will develop some of their properties important in cryptography. For example, finding large primes is essential in modern cryptography. The length of time required to factor large integers into their prime factors is the basis for the strength of some important modern cryptographic systems.
Primes
- Definition :
An integer
greater than is called prime if the only positive factors of are and . A positive integer that is greater than 1 and is not prime is called composite.
An integer
- Theorem : The Fundamental Theorem Of Arithmetic Every integer greater than 1 can be written uniquely as a prime or as the product of two or more primes, where the prime factors are written in order of non-decreasing size.
- Theorem :
If
is a composite integer, then has a prime divisor less than or equal to .
Because there are infinitely many primes, given any positive integer there are primes greater
than this integer. For almost all the last 300 years, the largest prime known has been an integer of the special form
- Theorem : The Prime Number Theorem
The ratio of
the number of primes not exceeding , and approaches as grows without bound. (Here is the natural logarithm of .)
Greatest Common Divisors and Least Common Multiples
- Definition :
Let
and be integers, not both zero. The largest integer such that and is called the greatest common divisor of and . The greatest common divisor of and is denoted by gcd . - Definition :
The integers
and are relatively prime if their greatest common divisor is . - Definition :
The integers
are pairwise relatively prime if gcd whenever .
Another way to find the greatest common divisor of two positive integers is to use the prime factorizations of these integers. Suppose that the prime factorizations of the positive integers
- Definition :
The least common multiple of the positive integers
and is the smallest positive integer that is divisible by both and . The least common multiple of and is denoted by lcm . - Theorem :
Let
and be positive integers. Then .
The greatest common divisor of two integers
- **Bézout’s Theorem :
If
and are positive integers, then there exist integers and such that gcd . - Definition :
If
and are positive integers, then integers and such that gcd are called Bézout Coefficients of and . Also, the equation gcd is called Bézout’s Identity. - Theorem :
Let
be a positive integer and let and be integers. If (mod ) and gcd then (mod ).
Solving Congruences
Linear Congruences
A congruence of the form
-
Theorem : If
and are relatively prime integers and then an inverse of modulo exists. Furthermore, this inverse is unique modulo . (That is, there is a unique positive integer less than that is an inverse of modulo and every other inverse of modulo m is congruent to modulo .) -
Theorem : The Chinese Remainder Theorem Let
be pairwise relatively prime positive integers greater than one and arbitrary integers. Then the system has a unique solution modulo . (There is a solution with and all other solutions are congruent modulo to this solution.)
Fermat’s Little Theorem
- Theorem : Fermat’s Little Theorem
If
is prime and is an integer not divisible by , then (mod ). Furthermore, for every integer we have (mod ). - Definition :
Let
be a positive integer. If is a composite positive integer, and (mod ), then is called a pseudo-prime to the base . - Definition :
A composite integer
that satisfies the congruence (mod ) for all positive integers with gcd is called a Carmichael number.
Primitive Roots and Discrete Logarithms
In the set of positive real numbers, if
- Definition :
A primitive root modulo a prime
is an integer in such that every nonzero element of is a power of . - Definition :
Suppose that
is a prime, is a primitive root modulo , and is an integer between and inclusive. If mod and we say that is the discrete logarithm of modulo to the base and we write (where the prime is understood).
Applications Of Congruences
Hashing Functions
A hashing function
Pseudo-random Numbers
The numbers generated by systematic methods are not truly random, they are called pseudorandom numbers.
The most commonly used procedure for generating pseudorandom numbers is the linear congruential method. We choose four integers: the modulus