Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.

Slides:



Advertisements
Similar presentations
Cryptography and Network Security Chapter 9
Advertisements

CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (4) Information Security.
Public Key Encryption Algorithm
By Claudia Fiorini, Enrico Martinelli, Fabio Massacci
1 The RSA Algorithm Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
Dr. Lo’ai Tawalbeh Summer 2007 Chapter 9 – Public Key Cryptography and RSA Dr. Lo’ai Tawalbeh New York Institute of Technology (NYIT) Jordan’s Campus INCS.
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Public Encryption: RSA
Cryptography and Network Security Chapter 9. Chapter 9 – Public Key Cryptography and RSA Every Egyptian received two names, which were known respectively.
Public Key Cryptography and the RSA Algorithm
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
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.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Public-Key Cryptography and Message Authentication modified from slides of Lawrie Brown.
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.
1 Pertemuan 08 Public Key Cryptography Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
Cryptography and Network Security Chapter 9 5th Edition by William Stallings Lecture slides by Lawrie Brown.
“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.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
Lecture 5 Overview Does DES Work? Differential Cryptanalysis Idea – Use two plaintext that barely differ – Study the difference in the corresponding.
 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
RSA and its Mathematics Behind
RSA Ramki Thurimella.
Cryptography: RSA & DES Marcia Noel Ken Roe Jaime Buccheri.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Public-Key Encryption
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.
Computer and Network Security Rabie A. Ramadan Lecture 6.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
Some Number Theory Modulo Operation: Question: What is 12 mod 9?
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
Lecture 24 Public-Key Cryptography modified from slides of Lawrie Brown.
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
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.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Public Key Cryptosystems RSA Diffie-Hellman Department of Computer Engineering Sharif University of Technology 3/8/2006.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
COMP 424 Lecture 04 Advanced Encryption Techniques (DES, AES, RSA)
Fall 2002CS 395: Computer Security1 Chapter 9: Public Key Cryptography.
Lecture 4 Overview. Data Encryption Standard Combination of substitution and transposition – Repeated for 16 cycles – Provides confusion and diffusion.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Lecture 9 Overview. RSA Invented by Cocks (GCHQ), independently, by Rivest, Shamir and Adleman (MIT) Two keys e and d used for Encryption and Decryption.
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
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.
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
CPIS 312 Chapter Four: PUBLIC KEY CRYPTO. Index 2 A.Introduction A.1 Asymmetric Key Cryptography- Introduction A.2 General ideas about the Public Key.
RSA Algorithm Date: 96/10/17 Wun-Long Yang. Outline Introduction to RSA algorithm RSA efficient implementation & profiling.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Lecture 6 Overview.
Private-Key Cryptography
ICS 353: Design and Analysis of Algorithms
Lecture 6 Overview.
The RSA Public-Key Encryption Algorithm
Presentation transcript:

Lecture 8 Overview

Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial is called a polynomial-time algorithm. – An algorithm is considered to be efficient if it runs in polynomial time. CS 450/650 Lecture 8: Algorithm Background 2

Time and Space Should be calculated as function of problem size (n) – Sorting an array of size n, – Searching a list of size n, – Multiplication of two matrices of size n by n T(n) = function of n (time) S(n) = function of n (space) relative rates of growth – 1000n vs. n 2 3 CS 450/650 Lecture 8: Algorithm Background

Definitions  T(n) = O(f(n)): T is bounded above by f The growth rate of T(n) <= growth rate of f(n)  T(n) =  (g(n)): T is bounded below by g The growth rate of T(n) >= growth rate of g(n)  T(n) =  (h(n)): T is bounded both above and below by h The growth rate of T(n) = growth rate of h(n)  T(n) = o(p(n)): T is dominated by p The growth rate of T(n) < growth rate of p(n) 4 CS 450/650 Lecture 8: Algorithm Background

Time Complexity  C  O(n)  O(log n)  O(nlogn)  O(n 2 )  …  O(n k )  O(2 n )  O(k n )  O(n n ) 5 CS 450/650 Lecture 8: Algorithm Background Polynomial Exponential O(2 log n )

P, NP, NP-hard, NP-complete A problem belongs to the class P if the problem can be solved by a polynomial-time algorithm A problem belongs to the class NP if the correctness of the problem’s solution can be verified by a polynomial- time algorithm A problem is NP-hard if it is as hard as any problem in NP – Existence of a polynomial-time algorithm for an NP-hard problem implies the existence of polynomial solutions for every problem in NP NP-complete problems are the NP-hard problems that are also in NP 6 CS 450/650 Lecture 8: Algorithm Background

Relationships between different classes NP P NP-complete NP-hard 7 CS 450/650 Lecture 8: Algorithm Background

Lecture 9 Rivest-Shamir-Adelman (RSA) CS 450/650 Fundamentals of Integrated Computer Security Slides are modified from Hesham El-Rewini

RSA Invented by Cocks (GCHQ), independently, by Rivest, Shamir and Adleman (MIT) Two keys e and d used for Encryption and Decryption – The keys are interchangeable M = D(d, E(e, M) ) = D(e, E(d, M) ) – Public key encryption Based on problem of factoring large numbers – Not in NP-complete – Best known algorithm is exponential 9 CS 450/650 Lecture 9: RSA

RSA To encrypt message M compute – c = M e mod N To decrypt ciphertext c compute – M = c d mod N 10 CS 450/650 Lecture 9: RSA

Let p and q be two large prime numbers Let N = pq Choose e relatively prime to (p  1)(q  1) – a prime number larger than p-1 and q-1 Find d such that ed mod (p  1)(q  1) = 1 Key Choice 11 CS 450/650 Lecture 9: RSA

RSA Recall that e and N are public If attacker can factor N, he can use e to easily find d – since ed mod (p  1)(q  1) = 1 Factoring the modulus breaks RSA It is not known whether factoring is the only way to break RSA 12 CS 450/650 Lecture 9: RSA

Does RSA Really Work? Given c = M e mod N we must show – M = c d mod N = M ed mod N We’ll use Euler’s Theorem – If x is relatively prime to N then x  (N) mod N =1  (n): number of positive integers less than n that are relatively prime to n. If p is prime then,  (p) = p-1 13 CS 450/650 Lecture 9: RSA

Does RSA Really Work? Facts: – ed mod (p  1)(q  1) = 1 – ed = k(p  1)(q  1) + 1by definition of mod –  (N) = (p  1)(q  1) – Then ed  1 = k(p  1)(q  1) = k  (N) M ed = M (ed-1)+1 = M  M ed-1 = M  M k  (N) = M  (M  (N) ) k mod N = M  1 k mod N = M mod N 14 CS 450/650 Lecture 9: RSA

Example Select primes p=11, q=3. N = p* q = 11*3 = 33 Choose e = 3 check gcd(e, p-1) = gcd(3, 10) = 1 – i.e. 3 and 10 have no common factors except 1 check gcd(e, q-1) = gcd(3, 2) = 1 therefore gcd(e, (p-1)(q-1)) = gcd(3, 20) = 1 15 CS 450/650 Lecture 9: RSA

Example (cont.) p-1 * q-1 = 10 * 2 = 20 Compute d such that e * d mod (p-1)*(q-1) = 1 3 * d mod 20 = 1 d = 7 Public key = (N, e) = (33, 3) Private key = (N, d) = (33, 7) 16 CS 450/650 Lecture 9: RSA

Example (cont.) Now say we want to encrypt message m = 7 c = M e mod N = 7 3 mod 33 = 343 mod 33 = 13 – Hence the ciphertext c = 13 To check decryption, we compute M' = c d mod N = 13 7 mod 33 = 7 17 CS 450/650 Lecture 9: RSA

More Efficient RSA Modular exponentiation example – 5 20 = = 25 mod 35 A better way: repeated squaring – Note that 20 = 2  10, 10 = 2  5, 5 = 2  2 + 1, 2 = 1  2 – 5 1 = 5 mod 35 – 5 2 = (5 1 ) 2 = 5 2 = 25 mod 35 – 5 5 = (5 2 ) 2  5 1 = 25 2  5 = 3125 = 10 mod 35 – 5 10 = (5 5 ) 2 = 10 2 = 100 = 30 mod 35 – 5 20 = (5 10 ) 2 = 30 2 = 900 = 25 mod 35 No huge numbers and it’s efficient! CS 450/650 Lecture 9: RSA 18

RSA key-length strength RSA has challenges for different key-lengths – RSA-140 Factored in 1 month using 200 machines in 1999 – RSA-155 (512-bit) Factored in 3.7 months using 300 machines in 1999 – RSA-160 Factored in 20 days in 2003 – RSA-200 Factored in 18 month in 2005 – RSA-210, RSA-220, RSA-232, … RSA CS 450/650 Lecture 9: RSA

Symmetric vs Asymmetric Secret Key (Symmetric)Public Key (Asymmetric) Number of keys12 Protection of keyMust be kept secretOne key must be kept secret; the other can be freely exposed Best usesCryptographic workhorse; secrecy and integrity of datasingle characters to blocks of data, messages, files Key exchange, authentication Key distributionMust be out-of-bandPublic key can be used to distribute other keys SpeedFastSlow; typically, 10,000 times slower than secret key CS 450/650 Fundamentals of Integrated Computer Security 20

Group Work Find keys d and e for the RSA cryptosystem with p = 7 and q = 11 Solution – p*q = 77 – (p-1) * (q-1) = 60 – e = 37 – d = 13 – n = 13 * 37 = 481 = 1 mod CS 450/650 Lecture 9: RSA