Lecture 5-6 The RSA and Rabin Algorithms. The possibility of the public key cryptosystem was first publicly suggested by Diffie and Hellman. However,

Slides:



Advertisements
Similar presentations
ONE WAY FUNCTIONS SECURITY PROTOCOLS CLASS PRESENTATION.
Advertisements

BY : Darshana Chaturvedi.  INTRODUCTION  RSA ALGORITHM  EXAMPLES  RSA IS EFFECTIVE  FERMAT’S LITTLE THEOREM  EUCLID’S ALGORITHM  REFERENCES.
7. Asymmetric encryption-
Session 4 Asymmetric ciphers.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
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.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Asymmetric Cryptography part 1 & 2 Haya Shulman Many thanks to Amir Herzberg who donated some of the slides from
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
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.
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.
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.
Lecture 6: Public Key Cryptography
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.
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-.
CS5204 – Fall Cryptographic Security Presenter: Hamid Al-Hamadi October 13, 2009.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
Prime Numbers Prime numbers only have divisors of 1 and self
Cryptography A little number theory Public/private key cryptography –Based on slides of William Stallings and Lawrie Brown.
1 AN EFFICIENT METHOD FOR FACTORING RABIN SCHEME SATTAR J ABOUD 1, 2 MAMOUN S. AL RABABAA and MOHAMMAD A AL-FAYOUMI 1 1 Middle East University for Graduate.
Problems with symmetric (private-key) encryption 1) secure distribution of keys 2) large number of keys Solution to both problems: Public-key (asymmetric)
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
1 Lect. 13 : Public Key Encryption RSA ElGamal. 2 Shamir Rivest Adleman RSA Public Key Systems  RSA is the first public key cryptosystem  Proposed in.
4 th lecture.  Message to be encrypted: HELLO  Key: XMCKL H E L L O message 7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message + 23 (X) 12 (M) 2 (C) 10 (K) 11.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Private-Key Cryptography  traditional private/secret/single key cryptography uses one key  shared by both sender and receiver  if this key is disclosed.
Cryptography and Network Security Chapter 10 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Section 4.4: The RSA Cryptosystem Practice HW Handwritten and Maple Exercises p at end of class notes.
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.
1 Public-Key Cryptography and Message Authentication.
1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept Part I: Introduction to Number Theory Part II: Advanced Cryptography.
Computer and Network Security Rabie A. Ramadan Lecture 6.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
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.
Attacking RSA Brian Winant Reference “Twenty Years of Attacks on the RSA Cryptosystem” By Dan Boneh In Notices of the American Mathematical.
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 Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
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.
Primality Testing. Introduction The primality test provides the probability of whether or not a large number is prime. Several theorems including Fermat’s.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
COM 5336 Lecture 8 Digital Signatures
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
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.
Lecture 6. RSA Use in Encryption to encrypt a message M the sender: – obtains public key of recipient PU={e,n} – computes: C = M e mod n, where 0≤M
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
Key Exchange in Systems VPN usually has two phases –Handshake protocol: key exchange between parties sets symmetric keys –Traffic protocol: communication.
Public Key Cryptography. Asymmetric encryption is a form of cryptosystem in which Encryption and decryption are performed using the different keys—one.
@Yuan Xue CS 285 Network Security Public-Key Cryptography Yuan Xue Fall 2012.
Public Key Encryption Major topics The RSA scheme was devised in 1978
Handbook of Applied Cryptography - CH8, Public-Key Encryption
Introduction to Cryptography
The RSA Public-Key Encryption Algorithm
Presentation transcript:

Lecture 5-6 The RSA and Rabin Algorithms

The possibility of the public key cryptosystem was first publicly suggested by Diffie and Hellman. However, they did not present a practical implementation. In next few years, several methods were proposed. The most successful, based on the idea that factorization of integers into their prime factors is hard, was proposed by Rivest, Shamir, and Adleman in 1977 and is known as the RSA algorithm.

Although the cryptanalysis neither proved nor disproved RSA ’ s security, it does suggest a confidence level in the algorithm. Rabin developed a public-key cryptosystem based on the difficulty of computing a square root modulo a composite integer. Rabin ’ s work has a theoretic importance, since the security of the Rabin cryptosystem is exactly the intractability of the integer factorization problem.

The primary objective of an adversary who wishes to ‘ attack ’ a public-key encryption scheme is to systematically recover plaintext from ciphertext intended for some other entity. If this is achieved, the encryption scheme is informally said to have been broken. A more ambitious objective is key private recovery. A considerable attack is a chosen-ciphertext attack where an adversary selects ciphertext of its choice, and then obtains by some means the corresponding plaintext. (1) The (indifferent) chosen-ciphertext attack. (2) The adaptive chosen-ciphertext attack.

The public-key encryption schemes described in this lecture that there is a means for the sender of a message to obtain an authentic copy of the intended receiver ’ s public key. There are many techniques in practice by which authentic public keys can be distributed, including exchanging keys over a trusted channel, using a trusted public file, using an on-line trusted server, and using an off-line server and certificates.

Some of the public-key encryption schemes described in this lecture assume that the message to be encrypted is, at most, some fixed size (bit-length). Plaintext messages longer than this maximum must be broken into blocks, each of the appropriate size. To provide protection against manipulation (e.g., re-ordering) of the blocks, the Cipher Block Chaining (CBC) mode may be used.

Outline  RSA Encryption Algorithm  Implementation of RSA Encryption  Security of RSA Encryption  RSA Encryption in Practice  Rabin Encryption Algorithm  Implementation of Rabin Encryption  Security of Rabin Encryption  Summary of Public Key Encryption

1 RSA Encryption Algorithm 1.1 Description

1.1 Description (Continued)

1.2 Example

2 Implementation of RSA Encryption 2.1 Primality Testing It might be surprising, but factorization and primality testing are not the same. It is much easier to prove a number is composite than it is to factor it. There are many large integers that are known to be composite but that have not been factored.

2.1 Primality Testing (Continued)

2.2 Modular Exponentiation

3 Security of RSA Encryption 3.1 Security Parameters , d  p, q

3.1 Security Parameters , d  p, q (Continued)

3.2 Relation to Factoring

3.2.1 Exponent Factorization Method

3.2.1 Exponent Factorization Method (Continued)

3.2.2 Pollard ’ s p  1 Algorithm

3.2.2 Pollard ’ s p  1 Algorithm (Continued)

3.2.3 Quadratic Sieve

3.2.3 Quadratic Sieve (Continued)

3.2.4 Advance in Factoring

3.3 Small Encryption Exponent e

3.3 Small Encryption Exponent e (Continued)

3.4 Small Decryption Exponent d

3.5 Multiplicative Properties

3.5 Multiplicative Properties (Continued)

3.6 Common Modulus Attack

3.7 Partial Key Exposure Attacks

3.7 Partial Key Exposure Attacks (Continued)

3.8 Cycling Attacks

3.8 Cycling Attacks (Continued)

3.9 Message Concealing

3.9 Message Concealing (Continued)

3.10 Forward Search Attack

3.11 RSA-OAEP

3.11 RSA-OAEP (Continued)

3.12 Timing Attacks The implementation of a cryptographic algorithm can have weaknesses that were unanticipated by the designers of the algorithm. Adversaries can exploit these weaknesses to circumvent the security of the underlying cryptographic algorithm. Attacks on the implementations of cryptographic systems are a great concern to operators and users of secure systems.

3.12 Timing Attacks (Continued) Implementation attacks include timing attacks, power analysis attacks, fault insertion attacks, and electromagnetic emission attacks. We refer to them as side-channel attacks. The term side- channel is used to describe the leakage of unintended information from a supposedly tamper-resistant device, such as a smartcard.

3.12 Timing Attacks (Continued) In a timing attacks the side-channel is the device ’ s time required to perform private key operations. An adversary can carefully measure the operation of time of a vulnerable system to learn the secrets contained inside the device and break the entire system ’ s security. Actual systems are potentially at risk, including cryptographic tokens, network- based cryptosystems, and other applications where attackers can make reasonably accurate timing measurements.

3.12 Timing Attacks (Continued) Assumption environment. The adversary can observe the system decrypts several ciphertexts g. He also knows the hardware being used to calculate and can use this information to calculate the computation times for various steps that potentially occur in the process. In addition, let g d (mod n) is computed by the Algorithm 4.

3.12 Timing Attacks (Continued)

4 RSA Encryption in Practice 4.1 Recommended Size of Modulus Given the latest progress in algorithms for factoring integers, special number field sieve factoring algorithms, a modulus n of at least 1024 bits is recommended. For long term security, 2048-bit or larger moduli should be used.

4.2 Selecting Primes (1) The primes p and q should be selected so that factoring n = p  q is computationally infeasible. The major restriction on p and q in order to avoid the elliptic curve factoring algorithm is that p and q should be about the same bit-length, and sufficiently large. For example, if a 1024-bit modulus n is to be used, then each of p and q should be about 512 bits in length.

4.2 Selecting Primes (Continued) (2) Another restriction on the primes p and q is that the difference p  q should not be too small. If p and q are chosen at random, then p  q will be appropriately large with overwhelming probability.

4.2 Selecting Primes (Continued) (3) Many authors have recommended that p and q be strong primes. A prime p is said to be a strong prime if the following three conditions are satisfied: * p  1 has a large prime factor, denoted r; ** p+1 has a large prime factor; *** r  1 has a large prime factor.

The reason for the first condition is to foil Pollard ’ s p  1 factoring algorithm which is efficient only if n has a prime factor p such that p  1 is smooth. The second condition foils the p  1 factoring algorithm, which is efficient only if n has a prime factor p such that p  1 is smooth. Finally, the third condition ensures that the cycling attacks will fail.

If the prime p is randomly chosen and is sufficiently large, then both p  1 and p+1 can be expected to have large prime factors. Additionally, it has been shown that the chances of a cycling attack succeeding are negligible if p and q are randomly chosen. Thus, strong primes offer little protection beyond that offered by random primes. Given the current state of knowledge of factoring algorithms, there is no compelling reason for requiring the use of strong primes in RSA key generation. On the other hand, they require only minimal additional running time to compute. Thus there is little real additional cost in using them.

4.3 Exponents (1) If the encryption exponent e is chosen at random, then RSA encryption using the Algorithm 4 takes k modular squarings and an expected k/2 modular multiplications, where k is the bit-length of the modulus n. Encryption can be sped up by selecting e to be small and/or by selecting e with a small number of 1 ’ s in its binary representation.

(2) The encryption exponent e=3 is commonly used in practice. In this case, it is necessary that neither p  1 nor q  1 be divisible by 3. This results in a very fast encryption operation since encryption only requires 1 multiplication and 1 squaring. Another encryption exponent used in practice is e= = This number has only two 1 ’ s in its binary representation, and so encryption using the Algorithm 4 requires only 16 squarings and 1 multiplication. The encryption exponent e= has the advantage over e=3, since it is unlikely the same message will be sent to recipients.

(3) Due to small decryption exponent attack, it requires the secret exponent d >n Although Boneh and Durfee cannot state their attack as a theorem, since they cannot prove that it always succeeds. But experiments that they carried out demonstrate its effectiveness. They were not able to find a single example where the attack fails.

5 Rabin Encryption Algorithm 5.1 Description

5.1 Description (Continued)

6 Implementation of Rabin Encryption 6.1 Finding Square Roots

6.2 About Efficiency Rabin encryption is an extremely fast operation as it only involves a single modular squaring. By comparison, RSA encryption with e=3 takes one modular multiplication and one modular squaring. Rabin decryption is slower than encryption, but comparable in speed to RSA decryption.

6.3 Redundancy Problem A drawback of the Rabin public-key scheme is that the receiver is faced with the task of selecting the correct plaintext from among four possibilities. This ambiguity in decryption can easily be overcome in practice by adding pre- specified redundancy to the original plaintext prior to encryption. (For example, the last 64 bits of the message may be replicated.) Then, with high probability, exactly one of the four square roots of a legitimate ciphertext will possess this redundancy. If none of the square roots possesses this redundancy, then the receiver should reject the ciphertext as fraudulent.

(1) The Rabin public-key encryption scheme is susceptible to attacks similar to those on RSA described about small encryption exponent and forward search problems. It can be circumvented by salting the plaintext message. 7 Security of Rabin Encryption

(2) The task faced by a passive adversary is to recover plaintext m from the corresponding ciphertext c. This is precisely the SQROOT problem. The problems of factoring n and computing square roots modulo n are computationally equivalent. Hence, assuming that factoring n is computationally intractable, the Rabin public-key encryption scheme is provably secure against a passive adversary.

Justification. Suppose that one has a polynomial- time algorithm R for solving the SQROOT problem. This algorithm can then be used to factor a given composite integer n as follows. Select an integer x at random with gcd(x, n)=1, and compute a  x 2 (mod n). Next, algorithm R is run with inputs a and n, and a square root y of a modulo n is returned. If y  x (mod n), then the trial fails, and the above procedure is repeated with a new x chosen at random. Otherwise, then gcd(x  y, n) is guaranteed to be a non-trivial factor of n, namely, p or q. Since a has four square roots modulo n, the probability of success for each attempt is 1/2.

(3) While secure against an active adversary, the Rabin public-key encryption scheme succumbs to a chosen-ciphertext attack. Such an attack can be mounted as follows. The adversary selects a random integer m and computes c  m 2 (mod n). The adversary then presents c to A ’ s decryption machine, which decrypts c and returns some plaintext y. Since A does not know m, and m is randomly chosen, the plaintext y is not necessarily the same as m. With probability 1/2, y is not equal to  m (mod n), in which case gcd(m  y, n) is one of the prime factors of n. Otherwise, then the attack is repeated with a new m.

(4) If redundancy is used as above, the Rabin public-key encryption scheme is no longer susceptible to the chosen ciphertext attack. If an adversary selects a message m having the required redundancy and gives c  m 2 (mod n) to A's decryption machine, with very high probability the machine will return the plaintext m itself to the adversary (since the other three square roots of c will most likely not contain the required redundancy), providing no new information.

(4) (Continued) On the other hand, if the adversary selects a message m which does not contain the required redundancy, then with high probability none of the four square roots will possess the required redundancy. In this case, the decryption machine will fail to decrypt c and thus will not provide a response to the adversary. Hence, Rabin public-key encryption, suitably modified by adding redundancy, is of great practical interest.

8 Summary of Public Key Encryption 8.1 Requirements for Public Key Encryption In a public key system, the message set M, the key set K, and the encryption/decryption function E/D, must satisfy the following requirements: (1) E k (D k (m))=m and D k (E k (m))=m for every m  M. (2) For every m and every k, the values of E k (m) and D k (m) are easy to compute.

8.1 Requirements for Public Key Encryption (Continued) (3) For almost every k  K, if someone knows only the function E k, it is computationally infeasible to find an algorithm to compute D k. (4) Given k  K, it is easy to find the functions E k and D k.

8.1 Requirements for Public Key Encryption (Continued)

8.2 About Authentication and Non-Repudiation (1) In a symmetric system, authentication is easy but non-repudiation is not. (2) In an asymmetric system, authentication and non-repudiation are not. However, the goals are easily accomplished. For example, compute and send the message E kb (S ka (m))= E kb (D ka (m)) for the RSA algorithm.

8.3 Trapdoor Functions and Collections

8.3 Trapdoor Functions and Collections (Continued)

Thank you !