CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.

Slides:



Advertisements
Similar presentations
Cryptography and Network Security Chapter 9
Advertisements

Public Key Encryption Algorithm
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
CSE331: Introduction to Networks and Security Lecture 18 Fall 2002.
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
Public Encryption: RSA
CSE331: Introduction to Networks and Security Lecture 20 Fall 2002.
Cryptography & Number Theory
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
CSE 321 Discrete Structures Winter 2008 Lecture 8 Number Theory: Modular Arithmetic.
RSA Encryption William Lu. RSA Background  Basic technique first discovered in 1973 by Clifford Cocks of CESG (part of British GCHQ)  Invented in 1977.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Dr.Saleem Al_Zoubi1 Cryptography and Network Security Third Edition by William Stallings Public Key Cryptography and RSA.
Public Key Algorithms 4/17/2017 M. Chatterjee.
Introduction to Computer and Network Security Iliano Cervesato 2 September 2008 – Public-key Encryption.
The RSA Algorithm JooSeok Song Tue.
“RSA”. RSA  by Rivest, Shamir & Adleman of MIT in 1977  best known & widely used public-key scheme  RSA is a block cipher, plain & cipher text are.
Codes, Ciphers, and Cryptography-RSA Encryption
Introduction to Public Key Cryptography
Public Key Model 8. Cryptography part 2.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
Prime Numbers Prime numbers only have divisors of 1 and self
Network and Communications Network Security Department of Computer Science Virginia Commonwealth University.
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
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.
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
RSA and its Mathematics Behind
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Midterm Review Cryptography & Network Security
Improving Encryption Algorithms Betty Huang Computer Systems Lab
A Method for Obtaining Digital Signatures and Public-key Cryptosystems
Darci Miyashiro Math 480 April 29, 2013
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
RSA Public Key Crypto System. About RSA Announced in 1977 by Ronald Rivest, Adi Shamir, and Leonard Adleman Relies on the relative ease of finding large.
1 Public-Key Cryptography and Message Authentication.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
CS461/ECE422 Spring 2012 Nikita Borisov — UIUC1.  Text Chapters 2 and 21  Handbook of Applied Cryptography, Chapter 8 
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
The RSA Algorithm. Content Review of Encryption RSA An RSA example.
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
Cryptography & Network Security : Topic Seminar Description & Analysis Madhava.N 1RV06SCN05 2 nd Semester M.Tech CNE RVCE RSA ALGORITHM.
1 Network and Computer Security (CS 475) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson.
Chapter 3 – Public Key Cryptography and RSA (A). Private-Key Cryptography traditional private/secret/single-key cryptography uses one key shared by both.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
RSA The algorithm was publicly described in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman at MIT Partly used for PGP (Pretty Good Privacy) to encrypt.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
POON TENG HIN.  RSA  Shamir’s Three-Pass Protocol  Other issues.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Introduction to Number Theory
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
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.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Public Key Cryptography
Public Key Encryption and Digital Signatures
Private-Key Cryptography
ICS 353: Design and Analysis of Algorithms
Rivest, Shamir and Adleman
Analysis of the RSA Encryption Algorithm
The RSA Public-Key Encryption Algorithm
Presentation transcript:

CSE331: Introduction to Networks and Security Lecture 19 Fall 2002

CSE331 Fall Announcements Reminder: Project 2 is due Monday, Oct. 28 th

CSE331 Fall Recap Block Ciphers: DES Today: –Public Key Cryptography –RSA

CSE331 Fall Public Key Cryptography Sender encrypts using a public key Receiver decrypts using a private key Only the private key must be kept secret –Public key can be distributed at will Also called asymmetric cryptography Can be used for digital signatures Examples: RSA, El Gamal, DSA

CSE331 Fall Public Key Notation Encryption algorithm E : keyPub x plain  cipher Notation: K{msg} = E(K, msg) Decryption algorithm D : keyPriv x cipher  plain Notation: k{msg} = D(k,msg) D inverts E D(k, E(K, msg)) = msg Use capital “K” for public keys Use lower case “k” for private keys Sometimes E is the same algorithm as D

CSE331 Fall Secure Channel: Private Key K A,K B k A K A, K B k B AliceBart K B {Hello!} K A {Hi!}

CSE331 Fall Trade-offs for Public Key Crypto More computationally expensive than shared key crypto –Algorithms are harder to implement –Require more complex machinery More formal justification of difficulty –Hardness based on complexity-theoretic results A principal needs one private key and one public key –Number of keys for pair-wise communication is O(n)

CSE331 Fall RSA Algorithm Ron Rivest, Adi Shamir, Leonard Adleman –Proposed in 1979 Has withstood years of cryptanalysis –Not a guarantee of security! –But a strong vote of confidence. Hardware implementations: 1000 x slower than DES

CSE331 Fall RSA at a High Level Public and private key are derived from secret prime numbers –Keys are typically  256 bits (512, or 1024) Plaintext message (a sequence of bits) –Treated as a (large!) binary number Encryption is exponentiation To break the encryption, conjectured that one must be able to factor large numbers –Not known to be in P

CSE331 Fall Number Theory: Modular Arithmetic Examples: –10 mod 12 = 10 –13 mod 12 = 1 –( ) mod 12 = 23 mod 12 = 11 mod 12 –23  11 (mod 12) –“23 is congruent to 11 (mod 12)” a  b (mod n) iff a = b + kn (for some integer k) The residue of a modulo n is a number in 0…n-1

CSE331 Fall Modular Arithmetic Properties Commutative, Associative, Distributive Reduce intermediate results mod n: –(a + b) mod n = ((a mod n) + (b mod n)) mod n –(a – b) mod n = ((a mod n) – (b mod n)) mod n –(a * b) mod n = (( a mod n) * (b mod n)) mod n –(a * (b + c)) mod n = (((a * b) mod n) + (a * c) mod n)) mod n

CSE331 Fall Number Theory: Prime Numbers A prime number is an integer > 1 whose only factors are 1 and itself. Two integers are relatively prime if their only common factor is 1 –gcd = greatest common divisor –gcd(a,b) = 1 –gcd(15,12) = 3, so they’re not relatively prime –gcd(15,8) = 1, so they are relatively prime

CSE331 Fall Finite Fields (Galois Fields) For a prime p, the set of integers mod p forms a finite field Addition + Additive unit 0 Multiplication * Multiplicative unit 1 Inverses: n * n -1 = 1 for n  0 –Suppose p = 5, then the finite field is {0,1,2,3,4} –2 -1 = 3 because 2 * 3  1 mod 5 –4 -1 = 4 because 4 * 4  1 mod 5 Usual laws of arithmetic hold

CSE331 Fall Euler’s totient function:  (n)  (n) is the number of positive integers less than n that are relatively prime to n –  (12) = 4 –Relative primes of 12 (less than 12): {1, 5, 7, 11} For p a prime,  (p) = p-1. Why? For p,q two primes,  (p*q) = (p-1)*(q-1)

CSE331 Fall Fermat’s Little Theorem Generalized by Euler. Theorem: If gcd(a,n) = 1 then a  (n) mod n = 1. Easy to compute a -1 mod n –a -1 mod n = a  (n)-1 mod n –Why? a * a  (n)-1 mod n = a  (n)-1+1 mod n = a  (n) mod n = 1

CSE331 Fall Example of Fermat’s Little Theorem What is the inverse of 5, modulo 7? 7 is prime, so  (7) = mod 7 = mod 7 = 5 5 mod 7 = ((25 mod 7 * 5 3 mod 7) mod 7 = (4 mod 7 * 5 3 mod 7) mod 7 = ((4 mod 7 * 4 mod 7) mod 7 * 5 mod 7) mod 7 = (16 mod 7 * 5 mod 7) mod 7 = (2 * 5) mod 7 = 10 mod 7 = 3

CSE331 Fall RSA Key Generation Choose large primes p and q. –Should be roughly equal length (in bits) Let n = p*q Choose a random encryption exponent e –With requirement: e and (p-1)*(q-1) are relatively prime. Derive the decryption exponent d –d = e -1 mod ((p-1)*(q-1)) –d is e’s inverse mod ((p-1)*(q-1)) Public key: K = (e,n) pair of e and n Private key: k = (d,n) Discard primes p and q (they’re not needed anymore)

CSE331 Fall RSA Encryption and Decryption Message: m Assume m < n –If not, break up message into smaller chunks –Good choice: largest power of 2 smaller than n Encryption: E((e,n), m) = m e mod n Decryption: D((d,n), c) = c d mod n

CSE331 Fall Proof that D inverts E c d mod n = (m e ) d mod n(definition of c) = m ed mod n(arithmetic) = m k*(p-1)*(q-1) + 1 mod n(d inverts e) = m*m k*(p-1)*(q-1) mod n(arithmetic) = m*1 mod n(Fermat) = m (m < n)

CSE331 Fall Example RSA Choose p = 47, q = 71 n = p * q = 3337 (p-1)*(q-1) = 3220 Choose e relatively prime with 3220: e = 79 –Public key is (79, 3337) Find d = mod 3220 = 1019 –Private key is (1019, 3337) To encrypt m = –Break into chunks < 3337 – Encrypt: E((79, 3337), 688) = mod 3337 = 1570 Decrypt: D((1019, 3337), 1570) = mod 3337 = 688