Cryptography & Complexity
description
Transcript of Cryptography & Complexity
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, n2, n3, … 2n
2n is enormous 1, 2, 4, 8, 16, 32, 64, 256, … 264 = 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 584.54 years
A linear time question
Adding n=5 four digit numbers 1253+4367+8365+7394+8362
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 76243875 by 98725879n=16 digit problem
82 multiplications
82 additions
n2/4 complexity
7 6 2 4 3 8 7 5
x 9 8 7 2 5 8 7 9
6 8 6 1 9 4 8 7 5
5 3 3 7 0 7 1 2 5
6 0 9 9 5 1 0 0 0
3 8 1 2 1 9 3 7 5
1 5 2 4 8 7 7 5 0
5 3 3 7 0 7 1 2 5
6 0 9 9 5 1 0 0 0
6 8 6 1 9 4 8 7 5
7 5 2 7 2 4 3 5 7 7 7 4 1 1 2 5
An exp-time question
Find sum of numbers: 1 + 2 + … + 763653 The question requires n=6 digits to ask. The (simple-minded) answer requires (almost)
10n = 1,000,000 additions to compute. But a shortcut can get the answer
2
763654763653
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 370371518519 not a prime number? 555557 x 666667 is a
certificate that can be verified in 6 x 6 (n2 time).
Verifying all 106, 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. (1010 years) if every atom in the universe is a computer
(1070 atoms) that can do a computation in the time it take
light to travel the distance of an atom! (10-20 secs)
Cryptography
From Secret Codes and SpiesTo E-Banking and E-mailAnd on to Quantum Computing
One Way Functions
n is an integer between 1 and 10000000000. f(n) is digits 100 to 120 of sin(n). Sin(n)=0.2749841541342665865736721659577527097363147274852480138431
0018225352466407595583451935495524097693349152981333211826475694
So f(n) = 91529813332118264756 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 = fk (x) is easy.
Computing x = fk-1(y) is hard.
Computing x = fk-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
Plaintext Cyphertext
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 fp(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 keyknown by allmuch like a phone numberused to send them messages
Everyone has a private keykept secretused 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
Barrier Detector
XXX XX X XX X X xX X X X X X XX X X X X X X xX X X X x X XX X X XX X XX XXX
XXX XX X XX X X xX X X X X X XX X X X X X X xX X X X x X XX X X XX X XX XXX
X
X XX X XX XXX X X X XX X X X X X XX X X X XXX XX X XX X
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.