RSA and Public Key Cryptography Oct. 2002 Nathanael Paul.

Slides:



Advertisements
Similar presentations
RSA.
Advertisements

Public Key Encryptions CS461/ECE422 Fall Reading Material Text Chapters 2 and 20 Handbook of Applied Cryptography, Chapter 8 –
Public Key Cryptography INFSCI 1075: Network Security – Spring 2013 Amir Masoumzadeh.
1 Complexity ©D.Moshkovitz Cryptography Where Complexity Finally Comes In Handy…
Cryptography and Network Security Chapter 9
RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
Asymmetric-Key Cryptography
Public Key Cryptosystems - RSA Receiver Sender Eavesdroppe r p q p q p q p and q prime.
Public Key Encryption Algorithm
7. Asymmetric encryption-
Great Theoretical Ideas in Computer Science.
Session 4 Asymmetric ciphers.
Public-key Cryptography Montclair State University CMPT 109 J.W. Benham Spring, 1998.
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
Public Key Cryptography
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Public Key Cryptography and the RSA Algorithm
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
CSE 321 Discrete Structures Winter 2008 Lecture 8 Number Theory: Modular Arithmetic.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender and receiver if this key is disclosed communications.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
1 Pertemuan 08 Public Key Cryptography Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
8: Network Security8-1 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key: K r e.g., key is knowing substitution.
CSCI 172/283 Fall 2010 Public Key Cryptography. New paradigm introduced by Diffie and Hellman The mailbox analogy: Bob has a locked mailbox Alice can.
Codes, Ciphers, and Cryptography-RSA Encryption
Public Key Model 8. Cryptography part 2.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
The RSA Algorithm Based on the idea that factorization of integers into their prime factors is hard. ★ n=p . q, where p and q are distinct primes Proposed.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Andreas Steffen, , 4-PublicKey.pptx 1 Internet Security 1 (IntSi1) Prof. Dr. Andreas Steffen Institute for Internet Technologies and Applications.
Chapter 12 Cryptography (slides edited by Erin Chambers)
Prime Numbers Prime numbers only have divisors of 1 and self
RSA Public Key Algorithm. RSA Algorithm history  Invented in 1977 at MIT  Named for Ron Rivest, Adi Shamir, and Len Adleman  Based on 2 keys, 1 public.
RSA Implementation. What is Encryption ? Encryption is the transformation of data into a form that is as close to impossible as possible to read without.
Great Theoretical Ideas in Computer Science.
RSA Ramki Thurimella.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
Public-Key Cryptography CS110 Fall Conventional Encryption.
Improving Encryption Algorithms Betty Huang Computer Systems Lab
Day 37 8: Network Security8-1. 8: Network Security8-2 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key:
Darci Miyashiro Math 480 April 29, 2013
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
1 Public-Key Cryptography and Message Authentication.
Cryptography and Network Security Public Key Cryptography and RSA.
Chapter 3 – Public Key Cryptography and RSA (A). Private-Key Cryptography traditional private/secret/single-key cryptography uses one key shared by both.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
Fall 2002CS 395: Computer Security1 Chapter 9: Public Key Cryptography.
PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9 PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9 Principles Applications Requirements RSA Algorithm Description.
CS Modular Division and RSA1 RSA Public Key Encryption To do RSA we need fast Modular Exponentiation and Primality generation which we have shown.
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Primality Testing. Introduction The primality test provides the probability of whether or not a large number is prime. Several theorems including Fermat’s.
Great Theoretical Ideas in Computer Science.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
Introduction to Elliptic Curve Cryptography CSCI 5857: Encoding and Encryption.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
Public Key Cryptosystem In Symmetric or Private Key cryptosystems the encryption and decryption keys are either the same or can be easily found from each.
Chapter 9 – Public Key Cryptography and RSA Every Egyptian received two names, which were known respectively as the true name and the good name, or the.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Key Exchange in Systems VPN usually has two phases –Handshake protocol: key exchange between parties sets symmetric keys –Traffic protocol: communication.
Public Key Encryption Major topics The RSA scheme was devised in 1978
Public Key Encryption.
Public Key Cryptosystem
PUBLIC-KEY ENCRYPTION Focusing on RSA
Number Theory and Euclidean Algorithm
Analysis of the RSA Encryption Algorithm
Appendix 5: Cryptography p
PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9
Presentation transcript:

RSA and Public Key Cryptography Oct Nathanael Paul

Some quick things to fill in some holes… (P,C,K,E,D) – P: plaintext – C: ciphertext – K: keyspace – E: encryption function – D: decryption function Someone recently asked me (and something for you to think about for next time): – Can cryptography and math be separated? Why or why not?

What is public key cryptography? Why is there a need? Asymmetric vs. Symmetric Problems solved by public key – Shared secret not needed – Authentication Trapdoor one-way function – Factoring integers – Discrete logs Slow, power hungry

Where did public key cryptography come from? Diffie and Hellman – Credited with invention (circa 1976) – One year later, RSA is invented – April 2002, ACM communications 1970 James Ellis (British Gov’t) – “The possibility of non-secret encryption” – NSA claims

Overview RSA – Rivest, Shamir, Adleman, 1977 Z n – Modular operations (the expensive part) – A sender looks up the public key of the receiver, and encrypts the message with that key – The receiver decrypts the message with his private key – Although, public key is public information, private key is secret but related to the public key in a special way

Essence of RSA P, C are in Z n n = p * q, where p and q are primes y = E k (m) = m b mod n m = D k (y) = y a mod n – D(y) = D(E(m)) = D(m b ) = (m b ) a = m – Factoring not necessary for decryption The public key is (b,n), everything else is private private key is (a,n)

Some relationships a is relatively prime to (p-1)(q-1) ab  1 (mod (p-1)(q-1))  (n) = (p-1)(q-1). ???  (n) = { x < n : gcd(x, n) = 1 } – “all integers less than n that are relatively prime to n” Let’s check to see if encryption and decryption really are inverse operations.

Checking RSA ab  1 (mod  (n)) – “ab is some multiple of (  (n) + 1) ab = t(  (n) + 1), t >= 1 (m b ) a  m t(  (n) + 1) (mod n)  (m  (n) ) t m (mod n)  (1) t m (mod n)by Euler’s Thm.  m (mod n) DONE

How to pick a public key Pick 2 primes, p and q Compute n = pq and  (n) = (p-1)(q-1) Choose a random b (1 < b <  (n)) – gcd (b,  (n)) = 1 Compute a = b -1 mod  (n) – Extended euclidean algorithm Publish the public key – (b, n) is a person’s public key now (i.e., people may now send encrypted text using this public key)

Bob chooses his public key He randomly chooses 17 th and 19 th primes, 59 and 67, respectively (p = 59, q = 67)  (n) = (58)(66) = 3828 Pick a random b, less than 3828 but > 1 – Let’s try Will that work? gcd(2669, 3828) = 1 Now, ab  1 (mod  (n)) – a * 2669  1 mod 3828 – a will exist iff gcd(a,  (n)) = 1

Bob finishes his calculations in making his public key… a = b -1 in Z n, recall a is the decryption exponent a = 1625 (b -1 = 1625 modd 3828) Bob’s private key (a, n) is (1625,3953), so now Bob publishes his public key (b,n) as (2669, 3953)

Alice wants to send Bob a message, m… Alice has plaintext 3128 to send. She will send E(m): – Alice encrypts with public key (b,n) or (2669,3953) – E(m) = mod 3953 = 3541 Bob receives the ciphertext 3541: – Bob decrypts with private key (a,n) or (1625,3953) – mod 3953 = 3128

Some notes about a,b, p, and q p and q must be large for security b, the encryption exponent, does not have to be that large (2 16 – 1 = is good) a, the decryption exponent, needs to be sufficiently large (512 to 2048 bits) Having to work with such large numbers, we need to look at some other elements of RSA.

RSA: Component Operations Exponentiation – We need to do it fast Factorization – Believed to be difficult (security is here) Finding prime numbers and testing primality – Rabin Miller test – New polynomial time algorithm

Fast Exponentiation a ^ 256 mod 7 – Don’t do (a*a*a…*a) 256 times and mod by 7 (a * b) mod p = (a mod p * b mod p) mod p – Shortcut: Look at binary representation of 256 – 256 = 2 8, (((((((a 2 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 and mod 7 each time you perform a square – 25 = = a ^ 25 mod n = (a * a 8 * a 16 ) mod n = (a * (((a 2 ) 2 ) 2 ) * ((((a 2 ) 2 ) 2 ) 2 )) mod n (((((((a 2 mod n)*a) mod n) 2 mod n) 2 mod n) 2 mod n) * a) mod n

Factorization Brute force is stupid and slow – d = 1,2,3,4,… Does d divide n? – Factoring n = pq. If p = p 2, so  n >= p – d can go high as  n in worst case – For n ~ 10 40, number of divisions Use structure of Z n – p –1 method (not really used, but a good speedup) – Pollard’s rho method – Quadratic sieve, Number Field Sieve (NFS) – Is there a better method out there?

Finding some prime numbers Easy to generate a number, but how do you know if it’s prime? Rabin Miller – If n is prime, output is always “could be” – If n is composite, output is “composite” or “could be” – If n is composite and “could be” is returned, the probability of a wrong answer is <= ¼ New polynomial algorithm that can say yes/no!

Using RSA: What can go wrong? Computing  (n) is no easier than factoring n From n = pq and  (n) = (p-1)(q-1), we obtain: – p 2 – (n -  (n) + 1)p + n = 0 – The roots of the above equation will be p and q If the decryption exponent, a is known, Bob needs to choose a new decryption exponent. – That isn’t enough! Bob must also choose a new modulus.

DES vs. RSA RSA is about 1500 times slower than DES – Exponentiation and modulus Generation of numbers used in RSA can take time Test n against known methods of factoring –

Key Distribution Then hard problem for symmetric (secret) key ciphers Transmitting a private key on an insecure channel – Asymmetric system solves problem

Primitive roots  is a pritimitive root of Fp you can get all elements of Fp from  – There exists an m such that:  m = n mod p, for 1 <= n < p m is unique Can you solve for m? Yes, but it’s hard by currently known methods (Discrete log) All primes have primitive roots

Example of primitive root Consider the element 2 x mod  1 mod  9 mod  2 mod  5 mod  4 mod  10 mod  8 mod  7 mod  3 mod  6 mod 13Primitive roots are not 2 6  12 mod 13found this way in Fp, but 2 7  11 mod 13this is an example of a primitive root.

Key distribution: Alice and Bob need to talk Insecure channel of communication First, set up our field that our numbers will operate within: – p, a large prime (sets up something called our field) –  is called a primitive root of Fp

Alice and Bob obtain a private key using public keys aa bb Bob Alice k o = (  a ) b k 1 = (  b ) a So, k 1 = k o, and a secret key is shared between Alice and Bob.

What does the adversary know, and what can he do? Knows  a,  b, , and p So we want to find the key, k – k =  ab – This is believed to be hard. If one knows how to compute discrete logs efficiently, then one can break this scheme (and other schemes based on public key cryptography)

Public Key Cryptographic Use Secure RPC SSL Cisco encrypting routers

Key distribution Key freshness Predistribution Agreement protocols

Trusted Authority – Alice and Bob need to talk (again) How about a TA issuing a certificate? – TA shares a secret key with each person that may ever want to communicate with TA – Alice asks for Bob’s public key, so TA issues a certificate: E (K, ID(Bob), T, L) – E is done with Alice and TA’s shared key – K is random, T is timestamp, L is lifetime – Alice can verify certificate is from TA – Ex. Kerberos

Reading “New Directions in Cryptography” – presentations/Arvind-NEWDIRS.pdf presentations/Arvind-NEWDIRS.pdf "A Method for Obtaining Digital Signatures and Public-Key Cryptosystems" –