



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Professor: Li; Class: Cryptography and Network Security; Subject: Computer Science; University: Illinois Institute of Technology; Term: Unknown 1989;
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




CS595-Cryptography and Network Security
CS595-Cryptography and Network Security
b|a if a=mb for an integer m b|a and c|b then c|a b|g and b|h then b|(mg+nh) for any int. m,n
P has only positive divisors 1 and p
No common divisors for p and q except 1
CS595-Cryptography and Network Security
The largest number that divides both a and b
Find the GCD of two numbers a and b, a<b
CS595-Cryptography and Network Security
let g 0 =b g 1 =a gi+1 = gi-1 mod gi when g (^) i =0 then gcd(a,b) = gi-
Why?
CS595-Cryptography and Network Security
Exist integers m and n : gcd(a,b) = ma + bn Example: a=2, b=3; we choose m=-1, n=1 so –2+3= a=6, b=11; we choose m=2, n=-1 so 2*6-11= Simple proof?
a = p 1 a 1 p2a 2 p 3 a3…. pn an where p (^) i is prime number CS595-Cryptography and Network Security
a ≡ b mod n says when divided by n that a and b have the same remainder It defines a relationship between all integers a ≡ a a ≡ b then b ≡ a a ≡ b, b ≡ c then a ≡ c
CS595-Cryptography and Network Security
(a+b) mod n ≡(a mod n) + (b mod n)
a-b mod n ≡ a+(-b) mod n
ab mod n derived from repeated addition Possible: ab ≡ 0 where neither a, b ≡ 0 mod n CS595-Cryptography and Network Security
a/b mod n multiplied by inverse of b: a/b = ab -1^ mod n b-1b ≡ 1 mod n 3 -1^ ≡7 mod 10 because 3*7 ≡ 1 mod 10 Inverse does not always exist! Only when gcd(b,n)=
CS595-Cryptography and Network Security
Associativity (a+b)+c ≡ a+(b+c) mod n Commutativity a+b ≡ b+a mod n Distributivity (a+b)c ≡ (ac)+(b*c) mod n
CS595-Cryptography and Network Security
b = a e^ mod p
find x where ax^ = b mod p
CS595-Cryptography and Network Security
CS595-Cryptography and Network Security
X=(x1,x2,x3)=(1,0,n); Y=(y1,y2,y3)=(0,1,a) If y3=0 return x3=gcd(a,n); no inverse If y3=1 return y3=gcd(a,n); y2=a -1^ mod n Q=[x3/y3] T=X-Q*Y X=Y; Y=T Goto 2 nd^ step
CS595-Cryptography and Network Security
If p is prime number Simple proof: (x+1)(x-1) ≡ 0 mod p So if we find another solution, then p can not be prime number! Miller and Rabin 1975, Randomly chosen integer a If a 2 ≡ 1 mod p then p is not prime number Integer a is called the witness Otherwise p maybe, or maybe not a prime number CS595-Cryptography and Network Security
Witness(a,n) Let b (^) kb (^) k-1…b 1 b 0 be the binary code of n- Let d= For i=k downto 0 x=d; d=d*d mod n If d=1 and x ≠ 1, and x ≠ n- return TRUE If b (^) i =1 then d=d*a mod n Endfor If d ≠ 1 then return TRUE Return FALSE
CS595-Cryptography and Network Security
Analysis the result of witness If returns TRUE, then n is not prime number Find other solutions for x 2 ≡ 1 mod n Otherwise, n maybe prime number Given odd n and random a Witness fails with probability less than 0. Run witness algorithm s times If one time, it is TRUE Then n is not prime number Otherwise, Pr( n is prime)>1-2 -s CS595-Cryptography and Network Security
Las Vegas Method Always produces correct results Runs in expected polynomial time Monte Carlo Method Runs in polynomial time May produce incorrect results with bounded probability No-Biased Monte Carlo Method Answer yes is always correct, but the answer no may be wrong Yes-biased Monte Carlo Method Answer no is always correct, but the answer yes may be wrong
CS595-Cryptography and Network Security
It actually test compositeness, not primality When it reports yes, the number is always composite When it reports no, input may be composite, prime Probability Result Pr(input=composite | ans=composite)= 1 Pr(ans=no | input=composite)<1/ Pr(input=composite | ans=no) ≤ 1/ CS595-Cryptography and Network Security
Unit: integer multiplication and modular arithmetic
The confidence is 1-2 -s^ if report prime The confidence is 1 if report non-prime
CS595-Cryptography and Network Security
The order of a modulo n is the smallest positive k such that a k≡1 mod n
Integer a is a primitive root of n if the order of a modulo n is φ(n) Not all integers have primitive root Example n=pq for primes p and q Prime p has φ(p-1) primitive roots CS595-Cryptography and Network Security
Compute x Time complexity O(e(ln p)1/3(ln ln p)2/3)
CS595-Cryptography and Network Security
Integer b is a quadratic residue of integer n if
Otherwise b is called quadratic nonresidue
CS595-Cryptography and Network Security
f(n)<=c*|g(n)|, for all n>=N 0 , for some c
solves any instance of a particular problem with input length n in time O(p(n)), where p is a polynomial
CS595-Cryptography and Network Security
N on-deterministic polynomial time algorithm ( NP ) - is one for which any guess at the solution of an instance of the problem may be checked for validity in polynomial time.
NP-complete problems - are a subclass of NP problems for which it is known that if any such problem has a polynomial time solution, then all NP problems have polynomial solutions.
Co-NP : the complements of NP problems.