Complexity of Computations Nicholas Tran Department of Mathematics & Computer Science Santa Clara University Santa Clara, CA 95053 USA.

Slides:



Advertisements
Similar presentations
Digital Signatures. Anononymity and the Internet.
Advertisements

Prime Numbers: A Recent Discovery, Secure Communications, and Million Dollar Prizes George T. Gilbert TCU January 29, 2003.
22C:19 Discrete Structures Integers and Modular Arithmetic
Public Key Encryption Algorithm
Week 3 - Friday.  What did we talk about last time?  AES  Public key cryptography.
Primality Testing By Ho, Ching Hei Cheung, Wai Kwok.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Prime An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. Examples: The first six primes are.
A Brief History of Computer Science William Klostermeyer.
Great Theoretical Ideas in Computer Science.
Public-key Cryptography Montclair State University CMPT 109 J.W. Benham Spring, 1998.
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
מבוא מורחב - שיעור 6 1 Lecture 6 High order procedures Primality testing The RSA cryptosystem.
Public Encryption: RSA
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.
Dr.Saleem Al_Zoubi1 Cryptography and Network Security Third Edition by William Stallings Public Key Cryptography and RSA.
The RSA Algorithm JooSeok Song Tue.
Codes, Ciphers, and Cryptography-RSA Encryption
 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
Cryptography A little number theory Public/private key cryptography –Based on slides of William Stallings and Lawrie Brown.
Introduction to Modular Arithmetic and Public Key Cryptography.
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
RSA and its Mathematics Behind
Great Theoretical Ideas in Computer Science.
Encryption Coursepak little bit in chap 10 of reed.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
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.
Elements of Coding and Encryption Continuation 1.
RSA Prepared by: SITI ZAINAH ADNAN
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
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.
Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
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.
David Kauchak CS52 – Spring 2015
CS Modular Division and RSA1 RSA Public Key Encryption To do RSA we need fast Modular Exponentiation and Primality generation which we have shown.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
1 How to Multiply Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. integers, matrices, and polynomials.
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.
AF2. Turn off your phones Primes, gcd, some examples, reading.
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.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Public Key Encryption Major topics The RSA scheme was devised in 1978
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
PUBLIC-KEY ENCRYPTION Focusing on RSA
Public-key Cryptography
The RSA Algorithm JooSeok Song Tue.
Private-Key Cryptography
Number Theory and Euclidean Algorithm
Analysis of the RSA Encryption Algorithm
CSE 321 Discrete Structures
Practical Aspects of Modern Cryptography
Introduction to Number Theory
The RSA Public-Key Encryption Algorithm
Presentation transcript:

Complexity of Computations Nicholas Tran Department of Mathematics & Computer Science Santa Clara University Santa Clara, CA USA

How fast can computers add two integers ?

Running Time is measured... In terms of basic operations (digit addition) As a function of input size (number of digits)

A(n) = n (digit additions) a n a n-1 a n-2... a 2 a 1 + b n b n-1 b n-2... b 2 b c n+1 c n c n-1 c n-2... c 2 c 1

Linear Running Time is FAST! Assume: 3GHz processor (3 billion cycles / second) One basic operation = 10 cycles 64-bit words (19 decimal digits) Can add 4.7 million pairs of 64-bit integers in one second!

Is Linear Time Optimal ? Yes! Every bit must be examined

How fast can computers multiply two integers ? 1 2 *

M(n) = n 2 (digit mults) + (n-1)n (digit additions) a n a n-1 a n-2... a 2 a 1 * b n b n-1 b n-2... b 2 b

Quadratic Running Time is OK Assume: 3GHz processor (3 billion cycles / second) One basic operation = 10 cycles Can multiply 300 pairs of 1024-bit integers in one second.

Is Quadratic Time optimal ? No! Divide-and-conquer method: n Fast-Fourier-Transform: n log n

Divide and Conquer Multiplication A 1 a n... a 1+n/2 a n/2... a 1 A 0 B 1 b n... b 1+n/2 b n/2... b 1 B 0 A*B = 2 n (A 1 *B 1 ) + 2 n/2 [(A 1 – A 0 )*(B 0 – B 1 ) + A 1 *B 1 + A 0 *B 0 ] + A 0 *B 0

Running Time M(n) = 3M(n/2) = 3*(3M(n/4)) = 3*3*(3M(n/8)) =... = 3 lg n = n lg 3 = n

Open Question Linear-time algorithm for integer multiplication ?

How fast can computers multiply two matrices ? * =

MT(n) = n 3 (multiplications) Result matrix has n 2 entries Each entry requires n multiplications

Is Cubic Time optimal ? No! Divide-and-conquer method: n Fastest known: n 2.376

Open Question Quadratic-time algorithm for matrix multiplication ?

How fast can computers compute b x ? = \ \ \ \ \ \ \ \ \ \

Naïve algorithm: x multiplications b x = b*b*...*b (x times)

Better algorithm: 2n multiplications (n=lg x) b 21 = b = b 16 b 4 b 1 b b 2 = b*b b 4 = b 2 * b 2 b 8 = b 4 * b 4 b 16 = b 8 * b 8

How fast can computers find gcd(a,b) ? Greatest common divisor of 9 and 6 is 3

Naïve method: min(a,b) divisions Gcd(9, 6): 6 divides 6 but not 9 5 does not divide 6 4 does not divide 6 3 divides 6 AND 9

Euclidean Algorithm: 5*lg min(a, b) gcd(a, b) = gcd(b, a mod b) gcd( ,361) = gcd(361, 190) = gcd(190, 171) = gcd(171, 19) = gcd(19, 0) = 19

gcd(a, b) by factoring into primes 9 = 2 0 * = 2 1 * 3 1 gcd(9, 6) = 2 0 * 3 1

How fast can computers recognize primes ? Isprime(11) = true Isprime(314159) = true Isprime(27183) = fase

Naïve method: √x divisions Theorem: if x = ab, then either a or b is at most √x

Too slow for large x! Largest known prime: – 1 Would take ~ years (age of universe ~ years)

Major Breakthrough Agrawal, Kayal, Saxena published an algorithm in 2004 with running time (lg x) 6 Would take years on the largest known prime!

In practice... Probabilistic algorithm (Rabin) Very fast [(lg x) 2] but may make mistake Would take 40 days on the largest known prime

How fast can computers factor integers ? = 13 * 241 *

Open Question Fastest known algorithm for factoring integers is faster than x but slower than lg x Is there a fast algorithm for factoring integers ?

Major Breakthrough Shor published a (lg x) 3 method for quantum computers in 2001

RSA Cryptography Invented by Rivest, Shamir, Adleman in 1978 Seems unbreakable if there are no fast methods for integer factoring

How RSA works I put on my website two integers (n, e) n is the product of two secret big primes p, q e is chosen so that gcd(e, (p-1)(q-1)) = 1 I compute d so that de = 1 + multiple of (p-1)(q-1)

To send a message x You get (n, e) from my website and send x e (mod n) I decrypt by computing (x e ) d (mod n) = x Unless you can factor n = pq, it seems hard to find d

Example (Stinson) I put on my website (11413, 3533) = 101 * 113 gcd(3533, (100*112)) = 1 d = * 3533 = 1 (mod 11200)

Example (ctd.) To send me 9726, you compute (mod 11413) = 5761 To decode I compute (mod 11413) = 9726

Exploiting Hardness of Pattern Recognition

Even Harder Problems Traveling Salesman: shortest route starting from San Jose through n cities Partition: divide a set of n people into two groups, so that the total weight of each group is identical

NP-hard Problems Solutions are hard to find but easy to check A fast solution to any of these problems would yield a fast solution to integer factoring A one-million dollar prize is currently offered to a resolution of this issue

Summary