RSA & F ACTORING I NTEGERS BY: MIKE NEUMILLER & BRIAN YARBROUGH.

Slides:



Advertisements
Similar presentations
RSA.
Advertisements

RSA and Public Key Cryptography Oct Nathanael Paul.
RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
Integer Factorization By: Josh Tuggle & Kyle Johnson.
Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
Public Key Cryptosystems - RSA Receiver Sender Eavesdroppe r p q p q p q p and q prime.
Mathematical. Approach  Many of these problems read as brain teasers at first, but can be worked through in a logical way.  Just remember to rely on.
Great Theoretical Ideas in Computer Science.
FFT1 The Fast Fourier Transform. FFT2 Outline and Reading Polynomial Multiplication Problem Primitive Roots of Unity (§10.4.1) The Discrete Fourier Transform.
Computer Science 1620 Loops.
A Creative Way of Breaking RSA Azeem Jiva. Overview ● What is RSA? – Public Key Algorithm – Is it secure? ● Ways to break RSA – Discover the Public Key.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Factoring 1 Factoring Factoring 2 Factoring  Security of RSA algorithm depends on (presumed) difficulty of factoring o Given N = pq, find p or q and.
Computer Science 1620 Programming & Problem Solving.
Unit 171 Algorithms and Problem Solving - II Algorithm Efficiency Primality Testing Improved Primality Testing Sieve of Eratosthenes Primality Testing.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Factoring Algorithms Ref: D. Stinson, Cryptography - Theory and Practice, 2001.
CSC2110 Discrete Mathematics Tutorial 6 Chinese Remainder Theorem, RSA and Primality Test Hackson Leung.
Shor’s Algorithm Osama Awwad Department of Computer Science Western Michigan University July 12, 2015.
RSA Question 2 Bob thinks that p and q are primes but p isn’t. Then, Bob thinks ©Bob:=(p-1)(q-1) = Á(n). Is this true ? Bob chooses a random e (1 < e
Tallinn University of Technology Quantum computer impact on public key cryptography Roman Stepanenko.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
CSE 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality.
Foundations of Network and Computer Security J J ohn Black Lecture #14 Oct 1 st 2007 CSCI 6268/TLEN 5831, Fall 2007.
Quadratic Residuosity and Two Distinct Prime Factor ZK Protocols By Stephen Hall.
David Froot.  How do we transmit information and data, especially over the internet, in a way that is secure and unreadable by anyone but the sender.

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.
Generating RSA Primes Jim Townsend CSE633 Final Results Fall 2010.
Calculating Discrete Logarithms John Hawley Nicolette Nicolosi Ryan Rivard.
CS 312: Algorithm Analysis Lecture #3: Algorithms for Modular Arithmetic, Modular Exponentiation This work is licensed under a Creative Commons Attribution-Share.
Copyright, Yogesh Malhotra, PhD, 2013www.yogeshmalhotra.com SPECIAL PURPOSE FACTORING ALGORITHMS Special Purpose Factoring Algorithms For special class.
CPSC 490 Number Theory Primes, Factoring and Euler Phi-function Mar.31 st, 2006 Sam Chan.
Prime numbers Jordi Cortadella Department of Computer Science.
FFT1 The Fast Fourier Transform. FFT2 Outline and Reading Polynomial Multiplication Problem Primitive Roots of Unity (§10.4.1) The Discrete Fourier Transform.
Lecture note 8: Quantum Algorithms
Digital Signatures A primer 1. Why public key cryptography? With secret key algorithms Number of key pairs to be generated is extremely large If there.
MA/CSSE 473 Day 11 Primality testing summary Data Encryption RSA.
Introduction to Programming (in C++) Loops Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
Short course on quantum computing Andris Ambainis University of Latvia.
Quantum Factoring Michele Mosca The Fifth Canadian Summer School on Quantum Information August 3, 2005.
A Method for Obtaining Digital Signatures and Public-key Cryptosystems
Factorization of a 768-bit RSA modulus Jung Daejin Lee Sangho.
Strength of Cryptographic Systems Dr. C F Chong, Dr. K P Chow Department of Computer Science and Information Systems The University of Hong Kong.
Shor’s Algorithm -basic introduction –. The main goal for Shor’s Alg. Find the factors of a certain integer – Why?... Long story short: prime factors,
1 Introduction to Quantum Information Processing CS 467 / CS 667 Phys 467 / Phys 767 C&O 481 / C&O 681 Richard Cleve DC 3524 Course.
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.
What use are prime numbers? ?. o All the primes, apart from 2, are odd numbers. o 1 is not a prime number. Why? o There are infinitely many prime numbers!
ENCRYPTION TAKE 2: PRACTICAL DETAILS David Kauchak CS52 – Spring 2015.
9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.1 CSE565: Computer Security Lecture 7 Number Theory Concepts Shambhu Upadhyaya Computer Science & Eng. University.
Hashtables. An Abstract data type that supports the following operations: –Insert –Find –Remove Search trees can be used for the same operations but require.
Quantum Computing Michael Larson. The Quantum Computer Quantum computers, like all computers, are machines that perform calculations upon data. Quantum.
A Survey on Factoring Large Numbers ~ 巨大数の因数分解に関する調査 ~ Kanada Lab. M Yoshida Hitoshi.
1 Applications of Number Theory CS/APMA 202 Rosen section 2.6 Aaron Bloomfield.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Implementation of Public Key Encryption Algorithms
Chapter 1 Algorithms with Numbers. Bases and Logs How many digits does it take to represent the number N >= 0 in base 2? With k digits the largest number.
MA/CSSE 473 Day 09 Modular Division Revisited Fermat's Little Theorem Primality Testing.
1 Introduction to Quantum Information Processing CS 467 / CS 667 Phys 667 / Phys 767 C&O 481 / C&O 681 Richard Cleve DC 2117 Lecture.
MA/CSSE 473 Day 9 Primality Testing Encryption Intro.
1 Solve it with the Computer Rick Spillman CSCE 115 Spring 2013 Lecture 12.
RSA Encryption Greg Gronn Laura Trimmer. RSA Encryption  Requires two 30 digit prime numbers to create an encoding/decryption key.  Goal: analyze different.
Public Key Encryption Major topics The RSA scheme was devised in 1978
Public Key Cryptosystems - RSA
Number Theory (Chapter 7)
Design and Analysis of Prime Number Sieves
Parallel Quadratic Sieve
Factoring RSA Moduli: Current State of the Art J
Presentation transcript:

RSA & F ACTORING I NTEGERS BY: MIKE NEUMILLER & BRIAN YARBROUGH

INTEGER FACTORIZATION Reducing an integer into its prime components Useful for code breaking RSA uses a semi-prime number to encrypt data Semi-prime number: a number made by the multiplication of two prime numbers

RSA Public Key Cryptosystem Currently used key sizes: 1024 bits to 4096 bits Many versions have been cracked already Largest of which is the 768 bit version (RSA-768) RSA-1024 expected to be cracked in the near future

KEY GENERATION – PUBLIC KEY Public key consists of a semi-prime, n, made from two large prime numbers and an exponent, e. Steps to find n and e: Pick two distinct primes, p and q of similar bit-length Calculate n = p * q Compute φ (n) = (p – 1)(q – 1) Pick an integer e that is coprime with φ (n), such that 1 < e < φ (n) Encryption is c ≡ m e (mod n)

KEY GENERATION – PRIVATE KEY Private key consists of mod n, and an exponent, d. Use e, n and φ (n)) to create the private key. d ≡ e -1 (mod φ (n)) or find d given d ⋅ e ≡ 1 (mod φ (n)) Decode using m ≡ c d (mod n)

HOW DO WE BREAK IT? Private key consists of: mod n and d n is known, so mod n is known, thus d is all we have to find. d is created using: φ (n) and e e is known, so φ (n) is all we have to find now. φ (n) = (p – 1) (q – 1) So now we only need to find p and q n = p * q p and q are both primes, so use Integer Factorization!

FACTORING INTEGERS – THE SIMPLE SOLUTION Trial Division Easily understood, but laborious for the computer. Repeatedly try to divide a number by increasingly larger primes until the full factorization has been found. Similar to the way most humans would probably approach the problem.

EXAMPLE CODE FOR TRIAL DIVISION

int main(int argc, char * argv[]) { unsigned long n = 1; if (argc <= 1) { cout << "Please specify a number to factor: "; cin >> n; cout << endl; } else { n = atol(argv[1]); } cout << "Using Trial Division to calculate the prime factors of “ << n << "...\n" << endl; vector factors = trial_division(n); cout << "Factors found to be: "; for (unsigned int i = 0; i < factors.size(); ++i) { if (i > 0) { cout << ", "; } cout << factors[i]; } cout << endl; return 0; }

std::vector trial_division(unsigned long n) { std::vector factors; if (n == 1) { factors.push_back(1); return factors; } std::vector primes = prime_sieve(sqrt(n) + 1); for (unsigned int i = 0; i < primes.size(); ++i) { if (primes[i] * primes[i] > n) { break; } while (n % primes[i] == 0) { factors.push_back(primes[i]); n /= primes[i]; } } if (n > 1) { factors.push_back(n); } return factors; }

std::vector prime_sieve(unsigned long max) { std::vector is_prime; std::vector primes; is_prime.resize(max + 1, true); for (unsigned long i = 2; i <= max; ++i) { if (!is_prime[i]) { continue; } primes.push_back(i); for (unsigned long j = i * i; j <= max; j += i) { is_prime[j] = false; } } return primes; }

FACTORING INTEGERS – THE PARALLEL SOLUTIONS Quadratic Sieve (QS) Factored RSA-129 on April 2, GB of data was collected over 8 months using computers distributed across the internet. Processing of the collected data took another 45 hours on Bellcore’s MasPar supercomputer. Was fastest known method for traditional computers until the Number Field Sieve was discovered.

FACTORING INTEGERS – THE PARALLEL SOLUTIONS Number Field Sieve (NFS) Fastest known method for factoring Factored RSA-130 on April 10, 1996 All RSA numbers to be factored since have been done with NFS. Factored RSA-768 (232 digits) on December 12, 2009 after more than 2 years of calculations using a state-of-the-art distributed implementation of NFS.

EXAMPLE - RSA-768 FACTORED RSA-768 = When factored, RSA-768 = ×

FACTORING INTEGERS – THE QUANTUM SOLUTION Shor’s Algorithm Formulated in 1994 by Peter Shor. Has already been shown to work Factored 15 in 2001 and again in 2012 Factored 21 in 2012 Runs in polynomial time Substantially faster than all of our current methods!

COMPARING RUNTIMES

REQUIREMENTS FOR SHOR’S ALGORITHM The number must be odd If the number is even, you can always divide by 2 until you get an odd number and then run Shor’s Algorithm. The number must be a composite number This can be tested by simply checking if the number is already a prime The number must not be a power of a prime This is checked for by checking the square, cubic, …, k-roots of N where k ≤ log 2 (n)

HOW SHOR’S ALGORITHM WORKS Consists of two parts A reduction of the factoring problem to the problem of order-finding problem. This part simply turns the factoring problem into the problem of find the period of a function. This part can be done on a classical computer! A quantum algorithm to solve the order-finding problem. This part finds the period using the Quantum Fourier transform. This part is responsible for the incredible speedup of Shor’s Algorithm compared to our current methods.

INTEGER FACTORIZATION ALGORITHMS (RECAP) Trial Division Easily understood, but laborious for the computer. Quadratic Sieve (QS) Factored RSA-129 on April 2, 1994 after more than 8 months of calculations. Second fastest known method for traditional computers. Number Field Sieve (NFS) Fastest known method for factoring. Factored RSA-768 (232 digits) on December 12, 2009 after more than 2 years of calculations. Shor’s Algorithm Bad news for the RSA encryption if we get a quantum computer of capable of running it for large numbers.

QUESTIONS?