RSA: Genesis, Security, Implementation & Key Generation

Size: px
Start display at page:

Download "RSA: Genesis, Security, Implementation & Key Generation"

Transcription

1 ECE 646 Lecture 8 RSA: Genesis, Security, Implementation & Key Generation Public Key (Asymmetric) Cryptosystems Public key of Bob - K B Private key of Bob - k B Network Alice Encryption Decryption Bob

2 Trap-door one-way function Whitfield Diffie and Martin Hellman New directions in cryptography, 976 PUBLIC KEY X f(x) Y f - (Y) PRIVATE KEY Professional (NSA) vs. amateur (academic) approach to designing ciphers. Know how to break Russian ciphers 2. Use only well-established proven methods 3. Hire 50,000 mathematicians 4. Cooperate with an industry giant 5. Keep as much as possible secret. Know nothing about cryptology 2. Think of revolutionary ideas 3. Go for skiing 4. Publish in Scientific American 5. Offer a $00 award for breaking the cipher 2

3 3

4 Challenge published in Scientific American 977 Ciphertext: Public key: N = e = 9007 Award $00 (29 decimal digits) 4

5 Rivest estimation The best known algorithm for factoring a 29-digit number requires: trilion years = years assuming the use of a supercomputer being able to perform multiplication of 29 decimal digit numbers in ns Rivest s assumption translates to the delay of a single logic gate» 0 ps Estimated age of the universe: 00 bln years = 0 years Lehmer Sieve Bicycle chain sieve [D. H. Lehmer, 928] Computer Museum, Mountain View, CA 5

6 Machine à Congruences [E. O. Carissan, 99] Supercomputer Cray Computer Museum, Mountain View, CA 6

7 Early records in factoring large numbers Years 974 Number of decimal digits 45 Number of bits 49 Required computational power (in MIPS-years) Number of bits vs. number of decimal digits 0 #digits = 2 #bits #digits = (log 0 2) #bits» 0.30 #bits 256 bits = 77 D 384 bits = 6 D 52 bits = 54 D 768 bits = 23 D 024 bits = 308 D 2048 bits = 66 D 7

8 How to factor for free? A. Lenstra & M. Manasse, 989 Using the spare time of computers, (otherwise unused) Program and results sent by (later using WWW) Practical implementations of attacks Factorization, RSA Year Number of bits of N Number of decimal digits of N Method Estimated amount of computations QS 5000 MIPS-years GNFS 750 MIPS-years GNFS 2000 MIPS-years GNFS 8000 MIPS-years 8

9 Breaking RSA-29 When: Who: How: August April, 994, 8 months D. Atkins, M. Graff, A. K. Lenstra, P. Leyland volunteers from the entire world 600 computers from Cray C90, through 6 MHz PC, to fax machines Only 0.03% computational power of the Internet Results of cryptanalysis: The magic words are squeamish ossifrage An award of $00 donated to Free Software Foundation Elements affecting the progress in factoring large numbers computational power computer networks better algorithms increase of about 500 times Internet 9

10 RSA as a trap-door one-way function PUBLIC KEY M C = f(m) = M e mod N C M = f - (C) = C d mod N PRIVATE KEY N = P Q P, Q - large prime numbers e d º mod ((P-)(Q-)) RSA keys PUBLIC KEY PRIVATE KEY { e, N } { d, P, Q } N = P Q P, Q - large prime numbers e d º mod ((P-)(Q-)) 0

11 Why does RSA work? ()? M = C d mod N = (M e mod N) d mod N = M decrypted message original message e d º mod ((P-)(Q-)) e d º mod j(n) Euler s totient function Euler s totient (phi) function () j(n) - number of integers in the range from to N- that are relatively prime with N Special cases:. P is prime j(p) = P- Relatively prime with P:, 2, 3,, P- 2. N = P Q P, Q are prime j(n) = (P-) (Q-) Relatively prime with N: {, 2, 3,, P Q-} {P, 2P, 3P,, (Q-)P} {Q, 2Q, 3Q,, (P-)Q}

12 Euler s totient (phi) function (2) Special cases: 3. N = P 2 P is prime j(n) = P (P-) Relatively prime with N: {, 2, 3,, P 2 -} {P, 2P, 3P,, (P-)P} In general If N = P e P e2 2 P e3 3 P et t t j(n) = Õ P i ei- (P i -) i= The first 000 values of φ(n) 2

13 Euler s Theorem Leonard Euler, " a: gcd(a, N) = a j(n) º (mod N) Euler s Theorem - Justification () For N=0 For arbitrary N R = {, 3, 7, 9} R = {x, x 2,, x j(n) } Let a=3 S = { 3 mod 0, 3 3 mod 0, 3 7 mod 0, 3 9 mod 0 } = {3, 9,, 7} Let us choose arbitrary a, such that gcd(a, N) = S = {a x mod N, a x 2 mod N,, a x j(n) mod N} = rearranged set R 3

14 Euler s Theorem - Justification (2) For N=0 R = S x x 2 x 3 x 4 º (a x ) (a x 2 ) (a x 3 ) (a x 4 ) mod N x x 2 x 3 x 4 º a 4 x x 2 x 3 x 4 mod N a 4 º (mod N) For arbitrary N j(n) Õ i= j(n) Õ i= R = S j(n) x i º Õ a x i (mod N) i= j(n) x i º a j(n) Õ x i (mod N) i= a j(n) º (mod N) Why does RSA work? (2) M = C d mod N = (M e mod N) d mod N = = M e d mod N = e d º mod j(n) e d = + k j(n) = = M +k j(n) mod N = M (M j(n) ) k mod N = = M (M j(n) mod N) k mod N = = M k mod N = M 4

15 Efficient encryption and decryption Number of bits vs. number of decimal digits 0 #digits = 2 #bits #digits = (log 0 2) #bits» 0.30 #bits 256 bits = 77 D 384 bits = 6 D 52 bits = 54 D 768 bits = 23 D 024 bits = 308 D 2048 bits = 66 D 5

16 How to perform exponentiation efficiently? Y = X E mod N = X X X X X X X mod N E-times E may be in the range of 2 024» Problems: Solutions:. huge storage necessary to store X E before reduction 2. amount of computations infeasible to perform. modulo reduction after each multiplication 2. clever algorithms 200 BC, India, Chandah-Sûtra Exponentiation: Y = X E mod N Right-to-left binary exponentiation Left-to-right binary exponentiation E = (e L-, e L-2,, e, e 0 ) 2 Y = ; S = X; for i=0 to L- { if (e i == ) Y = Y S mod N; S = S 2 mod N; } Y = ; for i=l- downto 0 { Y = Y 2 mod N; if (e i == ) Y = Y X mod N; } 6

17 Right-to-left binary exponentiation Y = X E mod N E = (e L-, e L-2,, e, e 0 ) 2 S: X X 2 mod N X 4 mod N X 8 mod N X 2 L- mod N E: e 0 e e 2 e 3 e L- e Y = X 0 e (X 2 mod N) (X 4 e mod N) 2 e (X 8 3 mod N) (X 2 L- e L- mod N) (X a ) b = X ab X a X b = X a+b Y = X e e + 4 e e L- e L- mod N = L- å e i 2 i i=0 = X = X E mod N Right-to-left binary exponentiation: Example S: X X 2 mod N X 4 mod N X 8 mod N X 6 mod N E: e 0 e e 2 e 3 e Y = X X 2 mod N X 6 mod N = = X 9 mod N Y = 3 9 mod E = 9 = = (00) mod =9 9 2 mod = mod = mod = mod (27 mod ) 3 mod = 5 3 mod = 4 7

18 Left-to-right binary exponentiation Y = X E mod N E = (e L-, e L-2,, e, e 0 ) 2 E: e L- e L-2 e L-3 e e 0 Y = ((...((( 2 e X L- ) 2 e L-2 X ) 2 e L-3 e X ) 2. ) 2 e X ) 2 0 X mod N (X a ) b = X ab X a X b = X a+b Y = X (e L- 2 + e L-2 ) 2 + e L-3 ) e ) 2 + e 0 mod N = å e i 2 i = X 2L- e L- + 2 L-2 e L L-3 e L e +e 0 i=0 mod N = X = = X E mod N L- Left-to-right binary exponentiation: Example Y = 3 9 mod E = 9 = = (00) 2 E: e 4 e 3 e 2 e e Y = ((...((( 2 X ) 2 ) 2 ) 2 X) 2 X mod N = (((3 2 mod ) ) 2 mod ) 2 mod 3) 2 mod 3 mod = (8 mod ) 2 mod 3) 2 mod 3 mod = = (5 3) 2 mod 3 mod = = 4 2 mod 3 mod = = 5 3 mod = 4 Y = (X 8 X ) 2 X mod N = X 9 mod N 8

19 Exponentiation Example: Y = 7 2 mod Right-to-left binary exponentiation e = 2 = ( 0 0) 2 Left-to-right binary exponentiation Right-to-Left Binary Exponentiation in Hardware X E enable Y S MUL SQR output 9

20 Left-to-Right Binary Exponentiation in Hardware Y X Control Logic E MUL output Basic Operations of RSA Encryption C ciphertext L < k e public key exponent = M mod N plaintext public key modulus k-bits k-bits k-bits Decryption M plaintext L=k d = C mod ciphertext private key exponent N private key modulus k-bits k-bits k-bits 20

21 Time of Exponentiation in Software t EXP (e, L, k) = #modular_multiplications(e, L) t MULMOD (k) e, L e=3 2 4 e = F 4 = 2 + #modular_multiplications large random L-bit e L + #ones(e)» L 2 t MULMOD (k) - time of a single modular multiplication of two k-bit numbers modulo a k-bit number t MULMOD (k) = c sm k 2 Time of Exponentiation in Hardware t EXP (L, k) = L t MULMOD (k) t MULMOD (k) - time of a single modular multiplication of two k-bit numbers modulo a k-bit number t MULMOD (k) = c hm k 2

22 Algorithms for Modular Multiplication Multiplication Paper-and-pencil q(k 2 ) Karatsuba q(k 3/2 ) Schönhage-Strassen (FFT) Modular Reduction q(k ln(k)) Multiplication combined with modular reduction Montgomery algorithm q(k 2 ) classical Barrett q(k 2 ) the same complexity as underlying multiplication Selby-Mitchell q(k 2 ) Paper-and-Pencil Algorithm of Multiplication word = l bytes = l bits A n- A n-2... A A 0 A x B n- B n-2... B B 0 B Assertion: 2 words lg 2 n l D 0 = A 0 B 0 D = A 0 B + A B 0 + D 2 = A 0 B 2 + A B + A 2 B 0 + D 2n-2 2 words 3 words D 2n-4 D 2n D 2 3 words D 2n-4 = A n-3 B n- + A n-2 B n-2 + A n- B n-3 D 2n-3 = A n-2 B n- + A n- B n-2 D 2n-2 = A n- B n- D D 0 C 2n- C 2n-2... C n+ C n C n- C n-2... C C 0 C 22

23 Classical Algorithm of Modular Reduction x m x 2n- x 2n-2 x 2n-3... x n-... x x 0 : m n- m n-2... m 0 q n- m q n- = x 2n-b+ x 2n-2 m n- q n- = q n- + e e = 0,, 2 x 2n-2 x 2n-3... x n-... x x 0 : m n- m n-2... m 0 x 2n-3... x n-... x x 0 q n-2 = x 2n-2b+ x 2n-3 m n- q n-2 = q n-2 + e e = 0,, x n-... x x 0 Effect of the increase in the computer speed on the speed of encryption and decryption in RSA to keep the same security computer speed operand size encryption/decryption speed 23

24 Decryption using Chinese Remainder Theorem M d = C mod N C P = C mod P d P = d mod (P-) C Q = C mod Q d Q = d mod (Q-) d P d Q M P = C P mod P M Q = C Q mod Q where M = M P R Q + M Q R P mod N R P = (P - mod Q) P = P Q- mod N R Q = (Q - mod P) Q= Q P- mod N Let and Chinese Remainder Theorem N = n n 2 n 3... n M for any i, j gcd(n i, n j ) = Then, any number 0 A N- can be represented uniquely by A «(a = A mod n, a 2 = A mod n 2,, a M = A mod n M ) A can be reconstructed from (a, a 2,, a M ) using equation M A = å (a i N i (N - i mod n i )) mod N where N N i = = n i i= = n n 2... n i- n i+... n M 24

25 Chinese Remainder Theorem for N=P Q N = P Q gcd(p, Q) = M «(M p = M mod P, M Q = M mod Q) M = M P N P N P - mod P + M Q N Q N Q - mod Q mod N = M P Q ((Q - ) mod P) + M Q P ((P - ) mod Q) mod N = = M P R Q + M Q R P mod N Concealment of messages in the RSA cryptosystem Blakley, Borosh, 979 There exist messages that are not changed by the RSA encryption! For example: M= C = e mod N = M=0 C = 0 e mod N = 0 M=N-º- mod N C = (-) e mod N = - Every M such that M P = M mod P Î {, 0, -} M Q = M mod Q Î {, 0, -} C P = C mod P = (M e mod N) mod P = M e mod P = M Pe mod P = M P C Q = C mod Q = (M e mod N) mod Q = M e mod Q = M Qe mod Q = M Q 25

26 Concealment of messages in the RSA cryptosystem At least 9 messages not concealed by RSA! Blakley, Borosh, 979 Number of messages not concealed by RSA: s = ( + gcd(e-, P-)) ( + gcd(e-, Q-)) A. e=3 s = 9 B. gcd(e-, P-) = 2 and gcd(e-, Q-) = 2 s = 9 C. gcd(e-, P-) = P- and gcd(e-, Q-) = Q- s = P Q=N It is possible that all messages remain unconcealed by RSA! Optimal Assymetric Encryption Padding () Coding >68 bits message SEED Bellare-Rogaway MASK(SEED) masked_message MASK(masked_message) masked_message masked_seed 26

27 Optimal Assymetric Encryption Padding (2) Decoding Bellare-Rogaway masked_message masked_seed MASK(masked_message) SEED MASK(SEED) message >68 bits RSA Key Generation 27

28 prime number generation Generation of the RSA keys e P, Q Typically e = gcd(e, P-) = gcd(e, Q-) = gcd(e-, P-) = 2 gcd(e-, Q-) = 2 Extended Euclid s algorithm N = P Q d = e - mod (P-) (Q-) RSA as a trap-door one-way function PUBLIC KEY M C = f(m) = M e mod N C M = f - (C) = C d mod N PRIVATE KEY N = P Q P, Q - large prime numbers e d º mod ((P-)(Q-)) 28

29 Concealment of messages in the RSA cryptosystem At least 9 messages not concealed by RSA! Blakley, Borosh, 979 Number of messages not concealed by RSA: s = ( + gcd(e-, P-)) ( + gcd(e-, Q-)) A. e=3 s = 9 B. gcd(e-, P-) = 2 and gcd(e-, Q-) = 2 s = 9 C. gcd(e-, P-) = P- and gcd(e-, Q-) = Q- s = P Q=N It is possible that all messages remain unconcealed by RSA! Random search Random vs. Incremental Search primes Incremental search numbers tested for primality starting point chosen at random 29

30 Is there a sufficent number of primes to choose from? p(x) - the number of primes smaller than x 0 x p(x) = x ln(x) p(x) primes x 0 00 p(x) Number of bits vs. number of decimal digits 0 #digits = 2 #bits #digits = (log 0 2) #bits» 0.30 #bits 256 bits = 77 D 384 bits = 6 D 52 bits = 54 D 768 bits = 23 D 024 bits = 308 D 536 bits = 462 D 2048 bits = 66 D 30

31 Is there a sufficent number of primes of the given bit length to choose from? p k - the number of primes of the size of k-bits 0 2 k- 2 k p k primes p k = p(2 k ) - p(2 k- )»» 0.5 p(2 k )»» p(2 k- ) k p k Average distance between primes of the given bit length () primes 2 k- 2 k Average distance between two consecutive primes Average distance (k)» 2 k - 2 k- p k» 2 k- p(2 k- )» ln 2 k-»» 0.69 (k-) 3

32 Average distance between primes of the given bit length (2) Number of bits k Average distance between primes Average amount of odd numbers to test Euler s Theorem Leonard Euler, " a: gcd(a, N) = a j(n) º (mod N) 32

33 Fermat s Theorem Pierre de Fermat, 60?-665 " N prime a: gcd(a, N) = a N- º (mod N) Fermat primality test 33

34 Fermat primality test n composite L(n) Liars to the compositness of n W(n) Witnesses to the compositness of n {..n-} a Î W(n) iff a n- º mod n n composite Carmichael number Carmichael Numbers L(n) Liars to the compositness of n W(n) Witnesses to the compositness of n {..n-} W(n) = {a: a n, gcd(a, n)>} L(n) = j(n) W(n) = n-j(n) 34

35 Carmichael Numbers A composite integer is a Carmichael number iff k ³ 3 n= p p 2 p 3 p k p i are distinct primes, p i ¹p j for i ¹j "p i (p i -) (n-) Smallest Carmichael number n = 56 = 3 7 Among all numbers smaller or equal to 0 5 There are about prime numbers 0 5 Carmichael numbers Good probabilistic primality test n composite L(n) Liars to the compositness of n W(n) Witnesses to the compositness of n {..n-} " n composite W(n) ³ L(n) If a Î W(n) test returns n composite else test returns n probably prime or n pseudoprime to the base a 35

36 Miller-Rabin test n composite L(n) Strong liars to the compositness of n W(n) Strong witnesses to the compositness of n {..n-} " n composite L(n) j(n)/4 < (n-)/4 Miller-Rabin test n composite L(n), n- Strong liars to the compositness of n W(n) Strong witnesses to the compositness of n For certain composite numbers, such as n = (2k+) there are only two strong liars: and n- {..n-} 36

37 Miller-Rabin test Mathematical Basis If n is prime then has only two square roots modulo n i.e., there are only two numbers, y and y 2, such that y 2 mod n = and y 22 mod n = y = and y 2 =n-º- mod n If n is composite then has at least four square roots modulo n i.e., there exist numbers, y, y 2, y 3, y 4, such that y 2 mod n =, y 22 mod n =, y 32 mod n =, y 42 mod n =, y =, y 2 =n-º- mod n, y 3 º ± mod n, y 4 º ± mod n Miller-Rabin test Algorithm () Find s and r, such that For example: n - = 2 s r, where r is odd n = 49 n - = 48 = s=4, r=3 n = 6 n- = 60 = s=2, r=5 37

38 Miller-Rabin test Algorithm (2) Compute a n- mod n = ( ((a r mod n) 2 mod n) 2 mod n ) 2 mod n = s squarings square mod n a r (a r ) 2 (a r ) 2 2 (a r ) (a r ) 2 s- (a r ) 2 s mod n square root mod n Miller-Rabin test Algorithm (3) square mod n a r (a r ) 2 (a r ) 2 2 (a r ) (a r ) 2 s- (a r ) 2 s mod n Case A: Case B: Case C: Case D: Case E: X º ± mod n square root mod n X X - X X - X X X X X X result of test probably prime or composite? 38

39 Miller-Rabin test Algorithm (3) square mod n a r (a r ) 2 (a r ) 2 2 (a r ) (a r ) 2 s- (a r ) 2 s mod n Case A: Case B: Case C: Case D: Case E: X º ± mod n square root mod n X X - X X - X X X X X X result of test n composite n composite probably prime or composite? Miller-Rabin test 39

40 Minimal number of the Miller-Rabin tests t, necessary to obtain the probability of error < 2-00 for a k-bit number n k t k t k t over Minimal number of the Miller-Rabin tests, t, for relatively small numbers n 40

41 Random search Random vs. Incremental Search primes Incremental search numbers tested for primality starting point chosen at random Using division by small primes primes numbers tested D D D D D D D D D D D D D D D D D R 2 D Division by small primes R 2 Miller-Rabin test with base 2 R Miller-Rabin test with the random base a R 2 R R R R R 4

42 Merten s Theorem The proportion of candidate odd integers NOT ruled out by the trial division by all primes B a(b) = (-/3) (-/5) (-/7) (-/B) a(b)».2 / ln B For B=256, a(b)» % of tested numbers discarded by the trial division Incremental search for a prime Efficient implementation of division by small primes Set of small primes n 0 = n 0 mod 3 = n 0 mod 5 = n 0 mod 7 = 0 n 0 mod = 3 n = mod 3= 0 +2 mod 5= mod 7= mod = 5 n = mod 3= mod 5= mod 7= mod = 7 n = mod 3= 0+2 mod 5= mod 7= mod = 9 n = mod 3= mod 5= mod 7= 9+2 mod = 0 n =0 0+2 mod 3= mod 5= +2 mod 7= mod = 2 42

43 Division by small primes Practical implementation (2) S[k]

ECE 646 Lecture 8. RSA: Genesis, Security, Implementation & Key Generation

ECE 646 Lecture 8. RSA: Genesis, Security, Implementation & Key Generation ECE 646 Lecture 8 RSA: Genesis, Security, Implementation & Key Generation Public Key (Asymmetric) Cryptosystems Public key of Bob - K B Private key of Bob - k B Network Alice Encryption Decryption Bob

More information

ECE 646 Lecture 9. RSA: Genesis, operation & security

ECE 646 Lecture 9. RSA: Genesis, operation & security ECE 646 Lecture 9 RSA: Genesis, operation & security Required Reading (1) W. Stallings, "Cryptography and Network-Security," Chapter 8.1 Prime Numbers Chapter 8.2 Fermat's and Euler's Theorems Chapter

More information

Efficient encryption and decryption. ECE646 Lecture 10. RSA Implementation: Efficient Encryption & Decryption. Required Reading

Efficient encryption and decryption. ECE646 Lecture 10. RSA Implementation: Efficient Encryption & Decryption. Required Reading ECE646 Lecture 10 RSA Implementation: Efficient Encryption & Decryption Required Reading W. Stallings, "Cryptography and etwork-security, Chapter 9.2 The RSA Algorithm Chapter 8.4 The Chinese Remainder

More information

RSA Key Generation. Required Reading. W. Stallings, "Cryptography and Network-Security, Chapter 8.3 Testing for Primality

RSA Key Generation. Required Reading. W. Stallings, Cryptography and Network-Security, Chapter 8.3 Testing for Primality ECE646 Lecture RSA Key Generation Required Reading W. Stallings, "Cryptography and Network-Security, Chapter 8.3 Testing for Primality A.Menezes, P. van Oorschot, and S. Vanstone, Handbook of Applied Cryptography

More information

ECE297:11 Lecture 12

ECE297:11 Lecture 12 ECE297:11 Lecture 12 RSA Genesis, operation & security Public Key (Asymmetric) Cryptosystems Public key of Bob - K B Private key of Bob - k B Network Alice Encryption Decryption Bob 1 Trap-door one-way

More information

ECE646 Lecture 11 Required Reading Chapter 8.3 Testing for Primality RSA Key Generation

ECE646 Lecture 11 Required Reading Chapter 8.3 Testing for Primality RSA Key Generation ECE646 Lecture equired eading W. Stallings, "Cryptography and Network-Security, Chapter 8. Testing for Primality SA Key Generation A.Menezes, P. van Oorschot, and S. Vanstone, Handbook of Applied Cryptography

More information

Introduction to Public-Key Cryptosystems:

Introduction to Public-Key Cryptosystems: Introduction to Public-Key Cryptosystems: Technical Underpinnings: RSA and Primality Testing Modes of Encryption for RSA Digital Signatures for RSA 1 RSA Block Encryption / Decryption and Signing Each

More information

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2 Contents 1 Recommended Reading 1 2 Public Key/Private Key Cryptography 1 2.1 Overview............................................. 1 2.2 RSA Algorithm.......................................... 2 3 A Number

More information

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography Peter Schwabe October 21 and 28, 2011 So far we assumed that Alice and Bob both have some key, which nobody else has. How

More information

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University Number Theory, Public Key Cryptography, RSA Ahmet Burak Can Hacettepe University abc@hacettepe.edu.tr The Euler Phi Function For a positive integer n, if 0

More information

Theme : Cryptography. Instructor : Prof. C Pandu Rangan. Speaker : Arun Moorthy CS

Theme : Cryptography. Instructor : Prof. C Pandu Rangan. Speaker : Arun Moorthy CS 1 C Theme : Cryptography Instructor : Prof. C Pandu Rangan Speaker : Arun Moorthy 93115 CS 2 RSA Cryptosystem Outline of the Talk! Introduction to RSA! Working of the RSA system and associated terminology!

More information

Lecture 1: Introduction to Public key cryptography

Lecture 1: Introduction to Public key cryptography Lecture 1: Introduction to Public key cryptography Thomas Johansson T. Johansson (Lund University) 1 / 44 Key distribution Symmetric key cryptography: Alice and Bob share a common secret key. Some means

More information

Topics in Cryptography. Lecture 5: Basic Number Theory

Topics in Cryptography. Lecture 5: Basic Number Theory Topics in Cryptography Lecture 5: Basic Number Theory Benny Pinkas page 1 1 Classical symmetric ciphers Alice and Bob share a private key k. System is secure as long as k is secret. Major problem: generating

More information

Cryptography. pieces from work by Gordon Royle

Cryptography. pieces from work by Gordon Royle Cryptography pieces from work by Gordon Royle The set-up Cryptography is the mathematics of devising secure communication systems, whereas cryptanalysis is the mathematics of breaking such systems. We

More information

CIS 551 / TCOM 401 Computer and Network Security

CIS 551 / TCOM 401 Computer and Network Security CIS 551 / TCOM 401 Computer and Network Security Spring 2008 Lecture 15 3/20/08 CIS/TCOM 551 1 Announcements Project 3 available on the web. Get the handout in class today. Project 3 is due April 4th It

More information

Mathematics of Cryptography

Mathematics of Cryptography UNIT - III Mathematics of Cryptography Part III: Primes and Related Congruence Equations 1 Objectives To introduce prime numbers and their applications in cryptography. To discuss some primality test algorithms

More information

Aspect of Prime Numbers in Public Key Cryptosystem

Aspect of Prime Numbers in Public Key Cryptosystem Aspect of Prime Numbers in Public Key Cryptosystem Md.Mehedi Masud, Huma Galzie, Kazi Arif Hossain and Md.Minhaj Ul Islam Computer Science and Engineering Discipline Khulna University, Khulna-9208, Bangladesh

More information

ECE 646 Lecture 8. RSA: Genesis, operation & security. Factorization in Software & Hardware. Trap-door one-way function

ECE 646 Lecture 8. RSA: Genesis, operation & security. Factorization in Software & Hardware. Trap-door one-way function ECE 646 Lecture 8 RSA: Genesis, operation & security. Factorization in Software & Hardware. Public Key (Asymmetric) Cryptosystems Public key of Bob - K B Private key of Bob - k B Network Alice Encryption

More information

Number Theory & Modern Cryptography

Number Theory & Modern Cryptography Number Theory & Modern Cryptography Week 12 Stallings: Ch 4, 8, 9, 10 CNT-4403: 2.April.2015 1 Introduction Increasing importance in cryptography Public Key Crypto and Signatures Concern operations on

More information

10 Public Key Cryptography : RSA

10 Public Key Cryptography : RSA 10 Public Key Cryptography : RSA 10.1 Introduction The idea behind a public-key system is that it might be possible to find a cryptosystem where it is computationally infeasible to determine d K even if

More information

Cryptography. Course 1: Remainder: RSA. Jean-Sébastien Coron. September 21, Université du Luxembourg

Cryptography. Course 1: Remainder: RSA. Jean-Sébastien Coron. September 21, Université du Luxembourg Course 1: Remainder: RSA Université du Luxembourg September 21, 2010 Public-key encryption Public-key encryption: two keys. One key is made public and used to encrypt. The other key is kept private and

More information

8.1 Principles of Public-Key Cryptosystems

8.1 Principles of Public-Key Cryptosystems Public-key cryptography is a radical departure from all that has gone before. Right up to modern times all cryptographic systems have been based on the elementary tools of substitution and permutation.

More information

The RSA cryptosystem and primality tests

The RSA cryptosystem and primality tests Mathematics, KTH Bengt Ek November 2015 Supplementary material for SF2736, Discrete mathematics: The RSA cryptosystem and primality tests Secret codes (i.e. codes used to make messages unreadable to outsiders

More information

Attacks on RSA & Using Asymmetric Crypto

Attacks on RSA & Using Asymmetric Crypto Attacks on RSA & Using Asymmetric Crypto Luke Anderson luke@lukeanderson.com.au 7 th April 2017 University Of Sydney Overview 1. Crypto-Bulletin 2. Breaking RSA 2.1 Chinese Remainder Theorem 2.2 Common

More information

Introduction to Modern Cryptography. Benny Chor

Introduction to Modern Cryptography. Benny Chor Introduction to Modern Cryptography Benny Chor RSA Public Key Encryption Factoring Algorithms Lecture 7 Tel-Aviv University Revised March 1st, 2008 Reminder: The Prime Number Theorem Let π(x) denote the

More information

Public-Key Cryptosystems CHAPTER 4

Public-Key Cryptosystems CHAPTER 4 Public-Key Cryptosystems CHAPTER 4 Introduction How to distribute the cryptographic keys? Naïve Solution Naïve Solution Give every user P i a separate random key K ij to communicate with every P j. Disadvantage:

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Ali El Kaafarani 1 Mathematical Institute 2 PQShield Ltd. 1 of 44 Outline 1 Public Key Encryption: security notions 2 RSA Encryption Scheme 2 of 44 Course main reference 3 of 44

More information

Introduction to Cryptography. Lecture 6

Introduction to Cryptography. Lecture 6 Introduction to Cryptography Lecture 6 Benny Pinkas page 1 Public Key Encryption page 2 Classical symmetric ciphers Alice and Bob share a private key k. System is secure as long as k is secret. Major problem:

More information

Applied Cryptography and Computer Security CSE 664 Spring 2018

Applied Cryptography and Computer Security CSE 664 Spring 2018 Applied Cryptography and Computer Security Lecture 12: Introduction to Number Theory II Department of Computer Science and Engineering University at Buffalo 1 Lecture Outline This time we ll finish the

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Spotlight on Science J. Robert Buchanan Department of Mathematics 2011 What is Cryptography? cryptography: study of methods for sending messages in a form that only be understood

More information

Chapter 8 Public-key Cryptography and Digital Signatures

Chapter 8 Public-key Cryptography and Digital Signatures Chapter 8 Public-key Cryptography and Digital Signatures v 1. Introduction to Public-key Cryptography 2. Example of Public-key Algorithm: Diffie- Hellman Key Exchange Scheme 3. RSA Encryption and Digital

More information

THE RSA CRYPTOSYSTEM

THE RSA CRYPTOSYSTEM THE RSA CRYPTOSYSTEM SILVIA ROBLES Abstract. This paper explores the history and mathematics behind the RSA cryptosystem, including the idea of public key cryptosystems and number theory. It outlines the

More information

Cryptography IV: Asymmetric Ciphers

Cryptography IV: Asymmetric Ciphers Cryptography IV: Asymmetric Ciphers Computer Security Lecture 7 David Aspinall School of Informatics University of Edinburgh 31st January 2011 Outline Background RSA Diffie-Hellman ElGamal Summary Outline

More information

Public Key Encryption

Public Key Encryption Public Key Encryption 3/13/2012 Cryptography 1 Facts About Numbers Prime number p: p is an integer p 2 The only divisors of p are 1 and p s 2, 7, 19 are primes -3, 0, 1, 6 are not primes Prime decomposition

More information

RSA: Genesis, operation & security. Factoring in Software & Hardware.

RSA: Genesis, operation & security. Factoring in Software & Hardware. ECE 646 Lecture 9 RSA: Genesis, operation & security. Factoring in Software & Hardware. Required Reading (1) W. Stallings, "Cryptography and Network-Security," Chapter 8.1 Prime Numbers Chapter 8.2 Fermat's

More information

Algorithmic Number Theory and Public-key Cryptography

Algorithmic Number Theory and Public-key Cryptography Algorithmic Number Theory and Public-key Cryptography Course 3 University of Luxembourg March 22, 2018 The RSA algorithm The RSA algorithm is the most widely-used public-key encryption algorithm Invented

More information

Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013

Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013 RSA Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013 Recap Recap Number theory o What is a prime number? o What is prime factorization? o What is a GCD? o What does relatively prime

More information

RSA RSA public key cryptosystem

RSA RSA public key cryptosystem RSA 1 RSA As we have seen, the security of most cipher systems rests on the users keeping secret a special key, for anyone possessing the key can encrypt and/or decrypt the messages sent between them.

More information

Mathematical Foundations of Public-Key Cryptography

Mathematical Foundations of Public-Key Cryptography Mathematical Foundations of Public-Key Cryptography Adam C. Champion and Dong Xuan CSE 4471: Information Security Material based on (Stallings, 2006) and (Paar and Pelzl, 2010) Outline Review: Basic Mathematical

More information

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1). 1 Background 1.1 The group of units MAT 3343, APPLIED ALGEBRA, FALL 2003 Handout 3: The RSA Cryptosystem Peter Selinger Let (R, +, ) be a ring. Then R forms an abelian group under addition. R does not

More information

Cryptography CS 555. Topic 18: RSA Implementation and Security. CS555 Topic 18 1

Cryptography CS 555. Topic 18: RSA Implementation and Security. CS555 Topic 18 1 Cryptography CS 555 Topic 18: RSA Implementation and Security Topic 18 1 Outline and Readings Outline RSA implementation issues Factoring large numbers Knowing (e,d) enables factoring Prime testing Readings:

More information

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017 CSC 580 Cryptography and Computer Security Math for Public Key Crypto, RSA, and Diffie-Hellman (Sections 2.4-2.6, 2.8, 9.2, 10.1-10.2) March 21, 2017 Overview Today: Math needed for basic public-key crypto

More information

The security of RSA (part 1) The security of RSA (part 1)

The security of RSA (part 1) The security of RSA (part 1) The modulus n and its totient value φ(n) are known φ(n) = p q (p + q) + 1 = n (p + q) + 1 The modulus n and its totient value φ(n) are known φ(n) = p q (p + q) + 1 = n (p + q) + 1 i.e. q = (n φ(n) + 1)

More information

RSA. Ramki Thurimella

RSA. Ramki Thurimella RSA Ramki Thurimella Public-Key Cryptography Symmetric cryptography: same key is used for encryption and decryption. Asymmetric cryptography: different keys used for encryption and decryption. Public-Key

More information

Asymmetric Encryption

Asymmetric Encryption -3 s s Encryption Comp Sci 3600 Outline -3 s s 1-3 2 3 4 5 s s Outline -3 s s 1-3 2 3 4 5 s s Function Using Bitwise XOR -3 s s Key Properties for -3 s s The most important property of a hash function

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 10 February 19, 2013 CPSC 467b, Lecture 10 1/45 Primality Tests Strong primality tests Weak tests of compositeness Reformulation

More information

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems CPE 776:DATA SECURITY & CRYPTOGRAPHY Some Number Theory and Classical Crypto Systems Dr. Lo ai Tawalbeh Computer Engineering Department Jordan University of Science and Technology Jordan Some Number Theory

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security Outline Quadratic residues Useful tests Digital Signatures CPSC 467b: Cryptography and Computer Security Lecture 14 Michael J. Fischer Department of Computer Science Yale University March 1, 2010 Michael

More information

Cryptosystem. Traditional Cryptosystems: The two parties agree on a secret (one to one) function f. To send a message M, thesendersendsthemessage

Cryptosystem. Traditional Cryptosystems: The two parties agree on a secret (one to one) function f. To send a message M, thesendersendsthemessage Cryptosystem Traditional Cryptosystems: The two parties agree on a secret (one to one) function f. To send a message M, thesendersendsthemessage f(m). The receiver computes f 1 (f(m)). Advantage: Cannot

More information

Public Key 9/17/2018. Symmetric Cryptography Review. Symmetric Cryptography: Shortcomings (1) Symmetric Cryptography: Analogy

Public Key 9/17/2018. Symmetric Cryptography Review. Symmetric Cryptography: Shortcomings (1) Symmetric Cryptography: Analogy Symmetric Cryptography Review Alice Bob Public Key x e K (x) y d K (y) x K K Instructor: Dr. Wei (Lisa) Li Department of Computer Science, GSU Two properties of symmetric (secret-key) crypto-systems: The

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Ali El Kaafarani Mathematical Institute Oxford University 1 of 74 Outline 1 Complexity measures 2 Algebra and Number Theory Background 3 Public Key Encryption: security notions

More information

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m. Final Exam Math 10: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 0 April 2002 :0 11:00 a.m. Instructions: Please be as neat as possible (use a pencil), and show

More information

1 What are Physical Attacks. 2 Physical Attacks on RSA. Today:

1 What are Physical Attacks. 2 Physical Attacks on RSA. Today: Today: Introduction to the class. Examples of concrete physical attacks on RSA A computational approach to cryptography Pseudorandomness 1 What are Physical Attacks Tampering/Leakage attacks Issue of how

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 9 February 6, 2012 CPSC 467b, Lecture 9 1/53 Euler s Theorem Generating RSA Modulus Finding primes by guess and check Density of

More information

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives [Part 2] Asymmetric-Key Encipherment Mathematics of Cryptography Forouzan, B.A. Cryptography and Network Security (International Edition). United States: McGraw Hill, 2008. Objectives To introduce prime

More information

basics of security/cryptography

basics of security/cryptography RSA Cryptography basics of security/cryptography Bob encrypts message M into ciphertext C=P(M) using a public key; Bob sends C to Alice Alice decrypts ciphertext back into M using a private key (secret)

More information

Discrete mathematics I - Number theory

Discrete mathematics I - Number theory Discrete mathematics I - Number theory Emil Vatai (based on hungarian slides by László Mérai) 1 January 31, 2018 1 Financed from the financial support ELTE won from the Higher Education

More information

RSA Cryptosystem and Factorization

RSA Cryptosystem and Factorization RSA Cryptosystem and Factorization D. J. Guan Department of Computer Science National Sun Yat Sen University Kaoshiung, Taiwan 80424 R. O. C. guan@cse.nsysu.edu.tw August 25, 2003 RSA Cryptosystem was

More information

Lecture V : Public Key Cryptography

Lecture V : Public Key Cryptography Lecture V : Public Key Cryptography Internet Security: Principles & Practices John K. Zao, PhD (Harvard) SMIEEE Amir Rezapoor Computer Science Department, National Chiao Tung University 2 Outline Functional

More information

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence:

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence: Linear Congruences The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence: ax b (mod m), a, b Z, m N +. (1) If x 0 is a solution then so is x k :=

More information

Carmen s Core Concepts (Math 135)

Carmen s Core Concepts (Math 135) Carmen s Core Concepts (Math 135) Carmen Bruni University of Waterloo Week 8 1 The following are equivalent (TFAE) 2 Inverses 3 More on Multiplicative Inverses 4 Linear Congruence Theorem 2 [LCT2] 5 Fermat

More information

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya BBM 205 Discrete Mathematics Hacettepe University http://web.cs.hacettepe.edu.tr/ bbm205 Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya Resources: Kenneth Rosen,

More information

Chapter 4 Asymmetric Cryptography

Chapter 4 Asymmetric Cryptography Chapter 4 Asymmetric Cryptography Introduction Encryption: RSA Key Exchange: Diffie-Hellman [NetSec/SysSec], WS 2008/2009 4.1 Asymmetric Cryptography General idea: Use two different keys -K and +K for

More information

Asymmetric Cryptography

Asymmetric Cryptography Asymmetric Cryptography Chapter 4 Asymmetric Cryptography Introduction Encryption: RSA Key Exchange: Diffie-Hellman General idea: Use two different keys -K and +K for encryption and decryption Given a

More information

Number Theory. Modular Arithmetic

Number Theory. Modular Arithmetic Number Theory The branch of mathematics that is important in IT security especially in cryptography. Deals only in integer numbers and the process can be done in a very fast manner. Modular Arithmetic

More information

Number Theory and Algebra: A Brief Introduction

Number Theory and Algebra: A Brief Introduction Number Theory and Algebra: A Brief Introduction Indian Statistical Institute Kolkata May 15, 2017 Elementary Number Theory: Modular Arithmetic Definition Let n be a positive integer and a and b two integers.

More information

Public Key Algorithms

Public Key Algorithms Public Key Algorithms Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 Jain@cse.wustl.edu Audio/Video recordings of this lecture are available at: http://www.cse.wustl.edu/~jain/cse571-09/

More information

CRYPTOGRAPHY AND NUMBER THEORY

CRYPTOGRAPHY AND NUMBER THEORY CRYPTOGRAPHY AND NUMBER THEORY XINYU SHI Abstract. In this paper, we will discuss a few examples of cryptographic systems, categorized into two different types: symmetric and asymmetric cryptography. We

More information

Math/Mthe 418/818. Review Questions

Math/Mthe 418/818. Review Questions Math/Mthe 418/818 Review Questions 1. Show that the number N of bit operations required to compute the product mn of two integers m, n > 1 satisfies N = O(log(m) log(n)). 2. Can φ(n) be computed in polynomial

More information

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS Modular arithmetics that we have discussed in the previous lectures is very useful in Cryptography and Computer Science. Here we discuss several

More information

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 9.1 Chapter 9 Objectives

More information

Cryptography. P. Danziger. Transmit...Bob...

Cryptography. P. Danziger. Transmit...Bob... 10.4 Cryptography P. Danziger 1 Cipher Schemes A cryptographic scheme is an example of a code. The special requirement is that the encoded message be difficult to retrieve without some special piece of

More information

Lecture Notes, Week 6

Lecture Notes, Week 6 YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE CPSC 467b: Cryptography and Computer Security Week 6 (rev. 3) Professor M. J. Fischer February 15 & 17, 2005 1 RSA Security Lecture Notes, Week 6 Several

More information

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE CPSC 467a: Cryptography and Computer Security Notes 13 (rev. 2) Professor M. J. Fischer October 22, 2008 53 Chinese Remainder Theorem Lecture Notes 13 We

More information

CS March 17, 2009

CS March 17, 2009 Discrete Mathematics CS 2610 March 17, 2009 Number Theory Elementary number theory, concerned with numbers, usually integers and their properties or rational numbers mainly divisibility among integers

More information

Discrete Mathematics GCD, LCM, RSA Algorithm

Discrete Mathematics GCD, LCM, RSA Algorithm Discrete Mathematics GCD, LCM, RSA Algorithm Abdul Hameed http://informationtechnology.pk/pucit abdul.hameed@pucit.edu.pk Lecture 16 Greatest Common Divisor 2 Greatest common divisor The greatest common

More information

Introduction to Cryptography. Lecture 8

Introduction to Cryptography. Lecture 8 Introduction to Cryptography Lecture 8 Benny Pinkas page 1 1 Groups we will use Multiplication modulo a prime number p (G, ) = ({1,2,,p-1}, ) E.g., Z 7* = ( {1,2,3,4,5,6}, ) Z p * Z N * Multiplication

More information

Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks

Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks 1 Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks Michael Albert michael.albert@cs.otago.ac.nz 2 This week Arithmetic Knapsack cryptosystems Attacks on knapsacks Some

More information

1 Number Theory Basics

1 Number Theory Basics ECS 289M (Franklin), Winter 2010, Crypto Review 1 Number Theory Basics This section has some basic facts about number theory, mostly taken (or adapted) from Dan Boneh s number theory fact sheets for his

More information

RSA Algorithm. Factoring, EulerPhi, Breaking RSA. Çetin Kaya Koç Spring / 14

RSA Algorithm. Factoring, EulerPhi, Breaking RSA.   Çetin Kaya Koç Spring / 14 RSA Algorithm http://koclab.org Çetin Kaya Koç Spring 2018 1 / 14 Well-Known One-Way Functions Discrete Logarithm: Given p, g, and x, computing y in y = g x (mod p) is EASY Given p, g, y, computing x in

More information

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems Cryptography Introduction to Number Theory 1 Preview Integers Prime Numbers Modular Arithmetic Totient Function Euler's Theorem Fermat's Little Theorem Euclid's Algorithm 2 Introduction to Number Theory

More information

NUMBER THEORY FOR CRYPTOGRAPHY

NUMBER THEORY FOR CRYPTOGRAPHY 1 CHAPTER 4. NUMBER THEORY FOR CRYPTOGRAPHY 1 INSTITÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW NUMBER THEORY FOR CRYPTOGRAPHY Contents 1 Number Theory for Cryptography 2 1.1 Linear

More information

Numbers. Çetin Kaya Koç Winter / 18

Numbers. Çetin Kaya Koç   Winter / 18 Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2016 1 / 18 Number Systems and Sets We represent the set of integers as Z = {..., 3, 2, 1,0,1,2,3,...} We denote the set of positive integers modulo n as

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by

More information

CS483 Design and Analysis of Algorithms

CS483 Design and Analysis of Algorithms CS483 Design and Analysis of Algorithms Lectures 2-3 Algorithms with Numbers Instructor: Fei Li lifei@cs.gmu.edu with subject: CS483 Office hours: STII, Room 443, Friday 4:00pm - 6:00pm or by appointments

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 8 February 1, 2012 CPSC 467b, Lecture 8 1/42 Number Theory Needed for RSA Z n : The integers mod n Modular arithmetic GCD Relatively

More information

CSE 521: Design and Analysis of Algorithms I

CSE 521: Design and Analysis of Algorithms I CSE 521: Design and Analysis of Algorithms I Randomized Algorithms: Primality Testing Paul Beame 1 Randomized Algorithms QuickSelect and Quicksort Algorithms random choices make them fast and simple but

More information

Cryptography and RSA. Group (1854, Cayley) Upcoming Interview? Outline. Commutative or Abelian Groups

Cryptography and RSA. Group (1854, Cayley) Upcoming Interview? Outline. Commutative or Abelian Groups Great Theoretical Ideas in CS V. Adamchik CS 15-251 Upcoming Interview? Lecture 24 Carnegie Mellon University Cryptography and RSA How the World's Smartest Company Selects the Most Creative Thinkers Groups

More information

Introduction to Modern Cryptography. Lecture RSA Public Key CryptoSystem 2. One way Trapdoor Functions

Introduction to Modern Cryptography. Lecture RSA Public Key CryptoSystem 2. One way Trapdoor Functions Introduction to Modern Cryptography Lecture 7 1. RSA Public Key CryptoSystem 2. One way Trapdoor Functions Diffie and Hellman (76) New Directions in Cryptography Split the Bob s secret key K to two parts:

More information

10 Modular Arithmetic and Cryptography

10 Modular Arithmetic and Cryptography 10 Modular Arithmetic and Cryptography 10.1 Encryption and Decryption Encryption is used to send messages secretly. The sender has a message or plaintext. Encryption by the sender takes the plaintext and

More information

My brief introduction to cryptography

My brief introduction to cryptography My brief introduction to cryptography David Thomson dthomson@math.carleton.ca Carleton University September 7, 2013 introduction to cryptography September 7, 2013 1 / 28 Outline 1 The general framework

More information

Addition. Ch1 - Algorithms with numbers. Multiplication. al-khwārizmī. al-khwārizmī. Division 53+35=88. Cost? (n number of bits) 13x11=143. Cost?

Addition. Ch1 - Algorithms with numbers. Multiplication. al-khwārizmī. al-khwārizmī. Division 53+35=88. Cost? (n number of bits) 13x11=143. Cost? Ch - Algorithms with numbers Addition Basic arithmetic Addition ultiplication Division odular arithmetic factoring is hard Primality testing 53+35=88 Cost? (n number of bits) O(n) ultiplication al-khwārizmī

More information

Math.3336: Discrete Mathematics. Mathematical Induction

Math.3336: Discrete Mathematics. Mathematical Induction Math.3336: Discrete Mathematics Mathematical Induction Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018

More information

Biomedical Security. Overview 9/15/2017. Erwin M. Bakker

Biomedical Security. Overview 9/15/2017. Erwin M. Bakker Biomedical Security Erwin M. Bakker Overview Cryptography: Algorithms Cryptography: Protocols Pretty Good Privacy (PGP) / B. Schneier Workshop Biomedical Security Biomedical Application Security (guest

More information

Lecture 6: Cryptanalysis of public-key algorithms.,

Lecture 6: Cryptanalysis of public-key algorithms., T-79.159 Cryptography and Data Security Lecture 6: Cryptanalysis of public-key algorithms. Helsinki University of Technology mjos@tcs.hut.fi 1 Outline Computational complexity Reminder about basic number

More information

RSA-256bit 數位電路實驗 TA: 吳柏辰. Author: Trumen

RSA-256bit 數位電路實驗 TA: 吳柏辰. Author: Trumen RSA-256bit 數位電路實驗 TA: 吳柏辰 Author: Trumen Outline Introduction to Cryptography RSA Algorithm Montgomery Algorithm for RSA-256 bit 2 Introduction to Cryptography 3 Communication Is Insecure Alice Bob Paparazzi

More information

RSA Implementation. Oregon State University

RSA Implementation. Oregon State University RSA Implementation Çetin Kaya Koç Oregon State University 1 Contents: Exponentiation heuristics Multiplication algorithms Computation of GCD and Inverse Chinese remainder algorithm Primality testing 2

More information

Encryption: The RSA Public Key Cipher

Encryption: The RSA Public Key Cipher Encryption: The RSA Public Key Cipher Michael Brockway March 5, 2018 Overview Transport-layer security employs an asymmetric public cryptosystem to allow two parties (usually a client application and a

More information

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic ECE 646 Lecture 5 Mathematical Background: Modular Arithmetic Motivation: Public-key ciphers RSA as a trap-door one-way function PUBLIC KEY message ciphertext M C = f(m) = M e mod N C M = f -1 (C) = C

More information

Introduction to Modern Cryptography. Benny Chor

Introduction to Modern Cryptography. Benny Chor Introduction to Modern Cryptography Benny Chor RSA: Review and Properties Factoring Algorithms Trapdoor One Way Functions PKC Based on Discrete Logs (Elgamal) Signature Schemes Lecture 8 Tel-Aviv University

More information