Cryptography & Complexity An amazing blend of Mathematics, Computer Science, Physics and achieving “the impossible”.
Complexity A Million Dollar Question
Complexity Computers are very fast But problems can be far more complex Complexity can be measured n, n 2, n 3, … 2 n 2 n is enormous 1, 2, 4, 8, 16, 32, 64, 256, … 2 64 = 18,446,744,073,709,551,616 1Ghz = 1,000,000,000 ops/sec 1 year = 31,557,600 secs Will be done counting in years
A linear time question Adding n=5 four digit numbers Question requires 20=4n digits to ask. Answer requires some 4n digit additions. As question size grows, the answer complexity is the same as the question complexity.
A quadratic-time question Multiply by n=16 digit problem 8 2 multiplications 8 2 additions n 2 /4 complexity x
An exp-time question Find sum of numbers: … The question requires n=6 digits to ask. The (simple-minded) answer requires (almost) 10 n = 1,000,000 additions to compute. But a shortcut can get the answer
Poly-time and Exp-time A method (algorithm) which takes polynomial time to solve, will remain poly-time on any conceivable machine. An algorithm that takes exponential time will remain exp-time on any machine. But shortcuts may make it possible to do some exp-time problem in poly-time using a different algorithm.
NP class Problems that have “certificates” that can be verified in polynomial time, can be solved in “at most” exponential time. Simply verify each possible input Brute force approach Is not a prime number? x is a certificate that can be verified in 6 x 6 (n 2 time). Verifying all 10 6, 6-digit certificates finds answer in exp-time. Recent poly-time algorithms.
P = NP ? The million dollar question. 1. Do ALL problems that are in NP have some clever way to do them in P time? 2. Does there exist at least one problem in NP that in not in P (ie. has no shortcut)? Most people believe in 2, but there is no proof (yet). If one such problem can be found, the NP- complete class proves that there are dozens more that are also NP.
If P ≠ NP … Then there are very hard problems that will take more years than the lifetime of the universe. (10 10 years) if every atom in the universe is a computer (10 70 atoms) that can do a computation in the time it take light to travel the distance of an atom! ( secs)
Cryptography From Secret Codes and Spies To E-Banking and And on to Quantum Computing
One Way Functions n is an integer between 1 and f(n) is digits 100 to 120 of sin(n). Sin(n)= So f(n) = Given f(n) how do you find that n=54321? No easy way to imagine other than brute force. But there are always many surprises in CS.
Write Only Memory Cryptography using one way functions is like Write Only Memory. But it has its uses. Password checking. Proving that you are the anonymous author. To create account User Name: “Arif Zaman” Password: “MyPassw0rd” Store the name and f(pwd) f(“MyPassw0rd”) = “qXpAkW” To authenticate a user Compare f(pwd) against the stored value.
Trapdoor functions Computing y = f k (x) is easy. Computing x = f k -1 (y) is hard. Computing x = f k -1 (y, key) is easy. So there is a way to go back, if we have a “key”. It is difficult to imagine an example, yet there are many such functions.
RSA Take r and s, two 1000 digit primes. p = r s is a 2000 digit non-prime. To make p from r and s is easy. To find r and s from p is hard. It is suspected that it is an exponentially hard problem to find factors.
Classic Substitution Ciphers Cipher Key: A→W, B→Q, C→S, D→P, E→L, … Shared secret key needed for both encryption and decryption. Key distribution is a major problem PlaintextCyphertext Encryption:A BAD CAB→W QWP SWQ Decryption:A BAD CAB←W QWP SWQ
Public Key Cryptography I secretly multiply two prime numbers p =r s and announce p to enemies and friends alike. I also announce how f p (t) anyone can encrypt messages to me using p (my public key). My friend then openly sends a message that can be read by enemies as well as myself. Only I (or anyone that can factor p) can decrypt message. Or by brute force: keep encrypting messages until you find one that encrypts to the right cyphertext.
Two keys not one Everyone has a public key known by all much like a phone number used to send them messages Everyone has a private key kept secret used to decipher messages
Digital Signatures When you do credit card transactions on the web, you can’t claim that someone else did it. The technology is the same.
Quantum Mechanics BarrierDetector X X XX XXX XXXx XXXXXXX XXXXXXXx XXXXxXX XXXX XXX XX X X X X XX XXX XXXx XXXXXXX XXXXXXXx XXXXxXX XXXX XXX XX X X X XX XXX XX X XXXXX XXXXXXX XXXXX X XX XXX XX X One slit – Dispersion occurs with light (photons) or small particles (electrons) You can count then hitting the detector Two slit – Interference A particle must be aware of both holes to have this behavior!
Implications One particle can do two (and more) computations at the same time. This is not science fiction, it has been done! Quantum computers could conceivably do large brute-force computations. Quantum methods can encrypt messages on the spins of particles in such a way that only the intended receiver can decrypt them. No copy can be made. Interception will destroy the message. Ultra safe, but expensive and currently only in lab.
The world is changing rapidly… Within your lifetimes, these will probably become practical realities. Already these new (less than 20 years old) sciences have dramatically changed the world.