Вы находитесь на странице: 1из 87

Unit 1 – Introduction &

Number theory
Dr.S.Kalaivani
Assistant Professor/ Dept. of CSE
IRTT

*. Notes, pictures, algorithms and other details are used for educational
purpose only. It is collected from various web sites and text books for teaching
purpose only
Topics Covered
1. Services
2. Mechanisms and attacks
3. OSI security architecture
4. Network security model
5. Classical Encryption techniques
– Symmetric cipher model
• Substitution techniques
• Transposition techniques
• Steganography

Unit 1- Introduction & Number Theory 2


6. FINITE FIELDS AND NUMBER THEORY
– Groups
– Rings
– Fields
– Modular arithmetic
– Euclid’s algorithm
– Finite fields
– Polynomial Arithmetic
– Prime numbers
– Fermat’s and Euler’s theorem
– Testing for primality
– Chinese remainder theorem
– Discrete logarithms.

Unit 1- Introduction & Number Theory 3


Introduction
• Computer Security is a protection to an
automated information system to attain
objective of integrity, availability and
confidentiality of information system
resources.

Unit 1- Introduction & Number Theory 4


Objectives
• Confidentiality
– Data Confidentiality
• Assure that confidential information is not made
available or disclosed to unauthorized individuals

– Privacy
• Assures that individuals control or influence what
information related to them may be collected and
stored and by whom and to whom that information
may be disclosed.

Unit 1- Introduction & Number Theory 5


• Integrity
– Data Integrity
• Assures that information and programs are changed
only in a specified and authorized manner.

– System Integrity
• Assures that a system performs its intended function in
an unimpaired manner, free from deliberate or
inadvertent unauthorized manipulation of the system.

• Availability
– Assures that systems work promptly and service is
not denied to authorized users.

Unit 1- Introduction & Number Theory 6


Challenges of Computer Security
• Security is not as simple as it might first
appear to the novice
• Always consider potential attacks on those
security features
• Security requires regular, even constant,
monitoring, and this is difficult in today’s
short-term, overloaded environment

Unit 1- Introduction & Number Theory 7


OSI Security Architecture
• OSI-Open system Interconnection
• The OSI security architecture is useful to managers for
providing security
• Developed as an international standard
• It focuses on security attacks, mechanisms, and
services
– Security attack: Any action that compromises the security
of information owned by an organization.
– Security mechanism: A process is designed to detect,
prevent, or recover from a security attack.
– Security service: A processing or communication service
that enhances the security of the data processing systems
and the information transfers of an organization.

Unit 1- Introduction & Number Theory 8


Threats VS Attack
• Threat
– A potential for violation of security or event that could
breach security and cause harm.
– A threat is a possible danger that might exploit a
vulnerability.

• Attack
– An assault on system security that derives from an
intelligent threat
– An intelligent act that is a deliberate attempt to
violate the security policy of a system.

Unit 1- Introduction & Number Theory 9


Security Attacks
• A passive attack attempts to learn or make use
of information from the system but does not
affect system resources.

Unit 1- Introduction & Number Theory 10


• Release of Message Content
– Telephone Conversation
– Electronic mail message
– File Transfer

• Traffic Analysis
– Masking content of Message (Encryption)

• Passive Attacks are very difficult to detect

• Do not involve any alteration of data

Unit 1- Introduction & Number Theory 11


• An active attack attempts to alter system
resources or affect their operation

Unit 1- Introduction & Number Theory 12


• Modification on data stream
• Masquerade
– One entity pretends to another entity Eg.
authentication sequence can be captured and resend
later
• Replay
– Capture of data unit and resend
• Modification of message
– Portion of message is altered/ delayed/reordered
• Denial of service
– Prevents/inhibits normal use
– Disruption of entire network

Unit 1- Introduction & Number Theory 13


Security Attacks with Services
• Confidentiality
– Snooping
– Traffic Analysis
• Integrity
– Modification
– Masquerade
– Replay
– Repudiation
• Availability
– Denial of Service (DOS)

Unit 1- Introduction & Number Theory 14


Security Services
• A communication service provided by a
system give specific kind of protection to
system resources.
• It implements security policies
• It is implemented by security mechanisms
– Authentication
– Access Control
– Data Confidentiality
– Data Integrity
– Non repudiation
Unit 1- Introduction & Number Theory 15
• Authentication
– Assure that communication is authentic
– Service assures two entities(source & destination)
are authentic
– Ensure connection is not interfered
• Peer entity authentication
• Data origin authentication

• Access Control
– It is the ability to limit and control access to host
systems

Unit 1- Introduction & Number Theory 16


• Data Confidentiality
– It is the protection of transmitted data from
passive attacks
– Protection of traffic flow from analysis
• Data Integrity
– Apply to stream of message and assures message
with no duplication, insertion, modification,
reordering.
• Non repudiation
– It prevents either sender or receiver denying a
transmitted message.

Unit 1- Introduction & Number Theory 17


Security Mechanisms
• Encipherment-math. Alg for message transfer
• Digital Signature-append data for proving
secure
• Access Control-enforce access rights
• Integrity-assure transfer
• Authentication Exchange
• Traffic padding –insert bits in message
• Routing control –select physical route
• Notarization-use third party
Unit 1- Introduction & Number Theory 18
Network Security Model

Unit 1- Introduction & Number Theory 19


• Message is transferred from one party to
another across internet service
• A logical information channel is established by
defining route through internet from source to
destination
• Security aspects used to protection of data
• Components
– Security related transformation
– Secret information shared by two end parties
• Trusted third party is needed for secure
transformation
Unit 1- Introduction & Number Theory 20
Basic tasks of security services
1. Design algorithm for secure transformation.
– Algorithm should not be defeated by opponent
2. Generate secret information to be used with
algorithm
3. Develop methods for sharing secret
information
4. Specify a protocol used by two participants

Unit 1- Introduction & Number Theory 21


Threats possibility
• Information Access threats
– Intercept / modify data on behalf of users who
should not have access to that data

• Service threats
– Exploits service flaws in computer to inhibit use by
legitimate users

Unit 1- Introduction & Number Theory 22


• Virus , Worms are example for software
attacks
• Created and introduced in system via disk via
unwanted logical code
• Security mechanism
– Gatekeeper function
• Password based login procedure
– Internal controls that monitor activity

Unit 1- Introduction & Number Theory 23


Rewind ????
• OSI Security Architecture
• Passive and active threats
• Categories of passive and active attacks
• Categories of security services
• Categories of security mechanisms
• Draw a relationship between service and attacks
• Draw a relationship between mechanism and
attacks

Unit 1- Introduction & Number Theory 24


Terms in Encryption
•Plaintext
•Ciphertext
•Enciphering/Encryption
•Deciphering/Decryption
•Cryptography – scheme for encryption
•Cryptographic System/Cipher
•Cryptanalysis – Techniques for decryption
•Cryptology – Area of cryptography & cryptanalysis

Unit 1- Introduction & Number Theory 25


Classical Encryption techniques
• Symmetric Encryption
– Conventional Encryption
– Single Key encryption

• Asymmetric Encryption
– Public key Encryption

Unit 1- Introduction & Number Theory 26


Symmetric Encryption Model

Unit 1- Introduction & Number Theory 27


Ingredients of symmetric encryption
• Plain text

• Encryption Algorithm

• Secret Key

• Cipher Text

• Decryption Algorithm
Unit 1- Introduction & Number Theory 28
Requirements for secure use of
conventional encryption
• Need of strong algorithm
• Sender and receiver must have copies of secret
key in secure fashion

• Impractical to decrypt message on basis of


ciphertext and encryption/decryption algorithm
• Do not keep algorithm as secret
• Keep Key as secret

Unit 1- Introduction & Number Theory 29


Model of symmetric cryptosystem

Unit 1- Introduction & Number Theory 30


• PlainText X
• Key K
• Encryption Algorithm E

• Cipher Text Y
Y=E(K,X) Encryption

• Decryption Algorithm D
X=D(K,Y) Decryption

Unit 1- Introduction & Number Theory 31


Cryptography
• Type of operations used for transforming
plaintext into ciphertext

• Number of keys used

• Way in which plaintext is processed

Unit 1- Introduction & Number Theory 32


Cryptanalysis Vs Bruteforce attack
• Cryptanalysis attack use algorithm with
knowledge of plaintext-ciphertext pairs

• Bruteforce attack means attacker tries every


possible key on piece of ciphertext until an
intelligent translation into plaintext is obtained.

• BFA –Trying every possible key until an intelligent


translation of ciphertext into plaintext is obtained

Unit 1- Introduction & Number Theory 33


Cryptanalysis attacks

Unit 1- Introduction & Number Theory 34


• Unconditionally secure encryption
– If ciphertext generated by a scheme does not
contain enough information to determine unique
plaintext no matter how much ciphertext is
available
– Cost is high
– Time exceeds lifetime of information

• Computationally secure encryption


– Time is limited for translation of ciphertext into
plaintext

Unit 1- Introduction & Number Theory 35


Traditional Cipher Category
• Stream Cipher
– Substitution
– Transposition

• Block Cipher
– DES
– AES

Unit 1- Introduction & Number Theory 36


Symmetric Encryption Techniques
• Substitution Techniques
– Letters of plaintext are replaced by other letters or by
numbers or symbols
– If plaintext is sequence of bits, ciphertext also in bit
patterns
• Transposition Techniques
– Permutation of plaintext letters
– Same letters of plaintext in ciphertext
• Steganography
– Plaintext message is hidden in some way
– Existence of message

Unit 1- Introduction & Number Theory 37


Substitution Techniques
• Monoalphabetic Cipher
– Caesar Cipher

• Polyalphabetic Ciphers
– Playfair Cipher
– Hill Cipher
– Vigenere cipher
– Vernam cipher

• One time pad


Unit 1- Introduction & Number Theory 38
Caesar Cipher
• The Caesar cipher involves replacing each
letter of the alphabet with the letter standing
three places further down the alphabet
• Encryption C = E(k, p) = (p + k) mod 26
• Decryption p = D(k, C) = (C - k) mod 26
• Brute force cryptanalysis
– Encryption and Decryption algorithm are known
– Only 25 keys to try
– Language of plaint text is known and easily
recognizable
Unit 1- Introduction & Number Theory 39
Monoalphabetic Cipher
• A permutation of a finite set of elements S is
an ordered sequence of all the elements of S,
with each element appearing exactly once.

• A powerful tool is to look at the frequency of


two-letter combinations, known as digrams.
• Eg. Caesar Cipher

Unit 1- Introduction & Number Theory 40


Disadvantage of Monoalphabetic
Cipher
• Encryption and Decryption are known
• 25 keys only used
• Language of plain text is known

Unit 1- Introduction & Number Theory 41


Polyalphabetic Ciphers
• Another way to improve on the simple
monoalphabetic technique is to use different
monoalphabetic substitutions as one proceeds
through the plaintext message.

• The general name for this approach is


polyalphabetic substitution cipher.

Unit 1- Introduction & Number Theory 42


• All these techniques have the following
features in common:
– A set of related monoalphabetic substitution rules
is used.
– A key determines which particular rule is chosen
for a given transformation

• Relation between plain text and cipher text is


one to many
• Cipher text is retrieved by plain text and
position of plain text
Unit 1- Introduction & Number Theory 43
Playfair Cipher
• The best-known multiple-letter encryption cipher is
the Playfair, which treats digrams in the plaintext as
single units and translates these units into ciphertext
digrams
• The Playfair algorithm is based on the use of a 5 * 5
matrix of letters constructed using a keyword.
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z

Unit 1- Introduction & Number Theory 44


• Plaintext is encrypted two letters at a time,
according to the following rules:
1. Repeating plaintext letters that are in the same pair are
separated with a filler letter, such as x, so that balloon would
be treated as ba lx lo on.
2. Two plaintext letters that fall in the same row of the matrix are
each replaced by the letter to the right, with the first element
of the row circularly following the last. For example, ar is
encrypted as RM.
3. Two plaintext letters that fall in the same column are each
replaced by the letter beneath, with the top element of the
column circularly following the last
4. Otherwise, each plaintext letter in a pair is replaced by the
letter that lies in its own row and the column occupied by the
other plaintext letter. Thus, hs becomes BP and ea becomes
IM

Unit 1- Introduction & Number Theory 45


Advantage of Playfair cipher
• there are only 26 letters, there are 26 * 26 = 676
digrams
• So that identification of individual digrams is
more difficult.
• The relative frequencies of individual letters
exhibit a much greater range than that of
digrams, making frequency analysis much more
difficult.
• For these reasons, the Playfair cipher was for a
long time considered unbreakable
Unit 1- Introduction & Number Theory 46
Hill Cipher
• M (M-1) = M-1 M = I, where I is the identity
matrix.
• I is a square matrix that is all zeros except for
ones along the main diagonal from upper left
to lower right.
• The inverse of a matrix does not always exist,
but when it does, it satisfies the preceding
equation.

Unit 1- Introduction & Number Theory 47


• This encryption algorithm takes m successive
plaintext letters and substitutes for them m
ciphertext letters.
• The substitution is determined by m linear
equations in which each character is assigned a
numerical value (a = 0, b = 1, c, z = 25)
c1 = (k11p1 + k21p2 + k31p3) mod 26
c2 = (k12p1 + k22p2 + k32p3) mod 26
c3 = (k13p1 + k23p2 + k33p3) mod 26
• This can be expressed in terms of row vectors and
matrices:6

or
Unit 1- Introduction & Number Theory 48
C = PK mod 26
(or)

C = E(K, P) = PK mod 26
P = D(K, C) = CK-1 mod 26 = PKK-1 = P

• Although the Hill cipher is strong against a


ciphertext-only attack, it is easily broken with
a known plaintext attack.

Unit 1- Introduction & Number Theory 49


Vigenere cipher
• C = C0, C1, C2, …, Cn-1 = E(K, P) =
E[(k0, k1, k2,…, km-1), (p0, p1, p2,…, pn-1)]
= (p0 + k0) mod 26, (p1 + k1) mod 26,..., (pm-1 + km-1) mod 26,
(pm + k0) mod 26, (pm+1 + k1) mod 26,..., (p2m-1 + km-1) mod 26, ...
Encryption Ci = (pi + ki mod m) mod 26
Decryption pi = (Ci - ki mod m) mod 26
• To encrypt a message, a key is needed that is
as long as the message.
• Usually, the key is a repeating keyword

Unit 1- Introduction & Number Theory 50


Vernam cipher

Unit 1- Introduction & Number Theory 51


One time Pad
• Random key is used in this method
• Key length should be equal to length of plain text
• Key generated newly at each time
• Key is used to encrypt and decrypt a single
message and then discarded
• Each new message requires a new key of same
length as new message. Such a scheme is known
as one time pad is unbreakable.
• It produces random output that bears no
statistical relationship to plaintext

Unit 1- Introduction & Number Theory 52


Difficulties of one time pad
• Practical problem of making large quantities of
random keys
• Problem of key distribution and protection
• Limited utility with low bandwidth channels
require very high security

Unit 1- Introduction & Number Theory 53


Transposition Techniques
• Rearrangement of original message
• Rail fence technique
• Message “Meet me after the toga party”
• Rail fence of depth 2

Unit 1- Introduction & Number Theory 54


Double transposition

Unit 1- Introduction & Number Theory 55


Steganography
• Plaintext is hidden in one of two ways
• Steganography conceals existence of message
• Other techniques
– Character marking
– Invisible ink
– Pin punctures
– Typewriter correction ribbon

Unit 1- Introduction & Number Theory 56


Finite Fields And Number Theory
• Groups, Ring and Fields are the fundamental
elements of branch of mathematics known as
abstract or modern algebra
• Groups
– A group G sometimes denoted by {G,.} is a set of
elements with a binary operation
• Closure
• Associative
• Identity Element
• Inverse Element

Unit 1- Introduction & Number Theory 57


• If a group has finite number of elements it is
referred as finite group
• Order of the group is equal to number of
elements in group
• Otherwise group is an infinite group
• A group is abelian with following conditions
– Commutative
• In additive group of integers is an infinite
cyclic group generated by element 1

Unit 1- Introduction & Number Theory 58


Rings
• A Ring {R,+,×} is a set of elements with two
binary operations called addition and
multiplication.

• Commutative
• Integral domain
– Multiplicative identity
– No zero divisors

Unit 1- Introduction & Number Theory 59


Fields
• A Field {F,+,×} is a set of elements with two
binary operations addition and multiplication.
• Multiplicative inverse
• a a-1 = a-1 a = 1

Unit 1- Introduction & Number Theory 60


Modular Arithmetic
• If a is an integer and n is a positive integer we
define a mod n

• Two integers said to be congruent modulo n, if


a mod n =b mod n ie a ≡ b (mod n)2

Unit 1- Introduction & Number Theory 61


Properties of Congruences

• Modular Arithmetic properties

Unit 1- Introduction & Number Theory 62


Euclidean Algorithm

Unit 1- Introduction & Number Theory 63


Finite Fields GF
• Order of finite field must be a power of prime
pn where n is a positive integer.

• GF stands for Galois Field


– GF(P)
– GF(2n)

• GF(p) is the set of integers {0,1, … , p-1} with


arithmetic operations modulo prime p

Unit 1- Introduction & Number Theory 64


GF(7)
 0 1 2 3 4 5 6
0 0 0 0 0 0 0 0
1 0 1 2 3 4 5 6
2 0 2 4 6 1 3 5
3 0 3 6 2 5 1 4
4 0 4 1 5 2 6 3
5 0 5 3 1 6 4 2
6 0 6 5 4 3 2 1

Unit 1- Introduction & Number Theory 65


Polynomial Arithmetic
• can compute using polynomials
f(x) = anxn + an-1xn-1 + … + a1x + a0 = ∑ aixi
• not interested in any specific value of x
• which is known as the indeterminate
• several alternatives available
– ordinary polynomial arithmetic
– poly arithmetic with coords mod p
– poly arithmetic with coords mod p and
polynomials mod m(x)

Unit 1- Introduction & Number Theory 66


Ordinary Polynomial Arithmetic
• add or subtract corresponding coefficients
• multiply all terms by each other
• eg
let f(x) = x3 + x2 + 2 and g(x) = x2 – x + 1
f(x) + g(x) = x3 + 2x2 – x + 3
f(x) – g(x) = x3 + x + 1
f(x) x g(x) = x5 + 3x2 – 2x + 2
Polynomial Arithmetic with Modulo
Coefficients
• when computing value of each coefficient do
calculation modulo some value
– forms a polynomial ring
• could be modulo any prime
• but we are most interested in mod 2
– ie all coefficients are 0 or 1
– eg. let f(x) = x3 + x2 and g(x) = x2 + x + 1
f(x) + g(x) = x3 + x + 1
f(x) x g(x) = x5 + x2
Polynomial Division
• can write any polynomial in the form:
– f(x) = q(x) g(x) + r(x)
– can interpret r(x) as being a remainder
– r(x) = f(x) mod g(x)
• if have no remainder say g(x) divides f(x)
• if g(x) has no divisors other than itself & 1 say
it is irreducible (or prime) polynomial
• arithmetic modulo an irreducible polynomial
forms a field
Polynomial GCD
• can find greatest common divisor for polys
– c(x) = GCD(a(x), b(x)) if c(x) is the poly of greatest degree
which divides both a(x), b(x)
• can adapt Euclid’s Algorithm to find it:
EUCLID[a(x), b(x)]
1. A(x) = a(x); B(x) = b(x)
2. if B(x) = 0 return A(x) = gcd[a(x), b(x)]
3. R(x) = A(x) mod B(x)
4. A(x) ¨ B(x)
5. B(x) ¨ R(x)
6. goto 2
Modular Polynomial Arithmetic
• can compute in field GF(2n)
– polynomials with coefficients modulo 2
– whose degree is less than n
– hence must reduce modulo an irreducible poly of
degree n (for multiplication only)
• form a finite field
• can always find an inverse
– can extend Euclid’s Inverse algorithm to find
Prime Numbers
• prime numbers only have divisors of 1 and self
– they cannot be written as a product of other numbers
– note: 1 is prime, but is generally not of interest
• eg. 2,3,5,7 are prime, 4,6,8,9,10 are not
• prime numbers are central to number theory
• list of prime number less than 200 is:
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59
61 67 71 73 79 83 89 97 101 103 107 109 113 127
131 137 139 149 151 157 163 167 173 179 181 191
193 197 199
Prime Factorisation
• to factor a number n is to write it as a product
of other numbers: n=a x b x c
• note that factoring a number is relatively hard
compared to multiplying the factors together
to generate the number
• the prime factorisation of a number n is when
its written as a product of primes
– eg. 91=7x13 ; 3600=24x32x52
Relatively Prime Numbers & GCD
• two numbers a, b are relatively prime if have no
common divisors apart from 1
– eg. 8 & 15 are relatively prime since factors of 8 are 1,2,4,8
and of 15 are 1,3,5,15 and 1 is the only common factor
• conversely can determine the greatest common
divisor by comparing their prime factorizations and
using least powers
– eg. 300=21x31x52 18=21x32 hence
GCD(18,300)=21x31x50=6
Fermat's Theorem
• P is a prime no
• a +ve no and not divisible by P
then ap-1 ≡ 1 (mod p)
– where p is prime and gcd(a,p)=1
• also known as Fermat’s Little Theorem
• also ap = p (mod p)
• useful in public key and primality testing
Euler Totient Function ø(n)
• when doing arithmetic modulo n
• complete set of residues is: 0..n-1
• reduced set of residues is those numbers (residues)
which are relatively prime to n
– eg for n=10,
– complete set of residues is {0,1,2,3,4,5,6,7,8,9}
– reduced set of residues is {1,3,7,9}
• number of elements in reduced set of residues is
called the Euler Totient Function ø(n)
Euler Totient Function ø(n)
• to compute ø(n) need to count number of
residues to be excluded
• in general need prime factorization, but
– for p (p prime) ø(p) = p-1
– for p.q (p,q prime) ø(pq) =(p-1)x(q-1)
• eg.
ø(37) = 36
ø(21) = (3–1)x(7–1) = 2x6 = 12
Euler's Theorem
• a generalisation of Fermat's Theorem
• aø(n) ≡ 1 (mod n)
– for any a,n where gcd(a,n)=1
– ø(p)= p-1
– n = p × q where p ,q are a prime no’s
– ø(n)= ø(pq)= ø(p)*ø(q)= (p-1) *(q-1)

• eg.
a=3;n=10; ø(10)=4;
hence 34 = 81 = 1 mod 10
a=2;n=11; ø(11)=10;
hence 210 = 1024 = 1 mod 11
Primality Testing
• Find largest prime no with minimum amount of time
• often need to find large prime numbers
• traditionally sieve using trial division
– ie. divide by all numbers (primes) in turn less than the
square root of the number
– only works for small numbers
• alternatively can use statistical primality tests based
on properties of primes
– for which all primes numbers satisfy property
– but some composite numbers, called pseudo-primes, also
satisfy the property
• can use a slower deterministic primality test
Miller Rabin Algorithm
• a test based on Fermat’s Theorem
• algorithm is:
TEST (n) is:
1. Find integers k, q, k > 0, q odd, so that (n–1)=2kq
2. Select a random integer a, 1<a<n–1
3. if aq mod n = 1 then return (“maybe prime");
4. for j = 0 to k – 1 do
2 jq
5. if (a mod n = n-1)
then return(" maybe prime ")
6. return ("composite")
Probabilistic Considerations
• if Miller-Rabin returns “composite” the
number is definitely not prime
• otherwise is a prime or a pseudo-prime
• chance it detects a pseudo-prime is < 1/4
• hence if repeat test with different random a
then chance n is prime after t tests is:
– Pr(n prime after t tests) = 1-4-t
– eg. for t=10 this probability is > 0.99999
Chinese Remainder Theorem
• used to speed up modulo computations
• if working modulo a product of numbers
– eg. mod M = m1m2..mk
• Chinese Remainder theorem lets us work in
each moduli mi separately
• since computational cost is proportional to
size, this is faster than working in the full
modulus M
x ≡ a1 mod m1
x ≡ a2 mod m2
x ≡ a3 mod m1 Find x
Steps:
1. Find M. M= m1 × m2 × m3
2. Fine M1,M2,M3 M1=M/m1 M2= M/m2
M3=M/m3
3. Find M1-1 , M2-1, M3-1 M M1-1 ≡ 1 mod m1
4. x = (a1 × M1 × M1-1 ) + (a2 × M2 × M2-1 ) × (a3
× M3 × M3-1 ) mod M

Unit 1- Introduction & Number Theory 83


x ≡ 2 mod 3
x ≡ 3 mod 5
x ≡ 2 mod 7 Find x

Unit 1- Introduction & Number Theory 84


Chinese Remainder Theorem
• can implement CRT in several ways
• to compute A(mod M)
– first compute all ai = A mod mi separately
– determine constants ci below, where Mi = M/mi
– then combine results to get answer using:
Primitive Roots
• from Euler’s theorem have aø(n)mod n=1
• consider am=1 (mod n), GCD(a,n)=1
– must exist for m = ø(n) but may be smaller
– once powers reach m, cycle will repeat
• if smallest is m = ø(n) then a is called a primitive
root
• if p is prime, then successive powers of a "generate"
the group mod p
• these are useful but relatively hard to find
Discrete Logarithms
• the inverse problem to exponentiation is to find the
discrete logarithm of a number modulo p
• that is to find x such that y = gx (mod p)
• this is written as x = logg y (mod p)
• if g is a primitive root then it always exists, otherwise
it may not, eg.
x = log3 4 mod 13 has no answer
x = log2 3 mod 13 = 4 by trying successive powers
• whilst exponentiation is relatively easy, finding
discrete logarithms is generally a hard problem

Вам также может понравиться