170 likes | 343 Views
Public Key Cryptography. Topical Lecture Week 10. A: Hey B, send me an encoded message. This is how you encode a message for me. Public: Listening to both sides of the conversation! B: Ok. Encodes a message into secret Code, and sends the Coded message. Public Key Cryptography.
E N D
Public Key Cryptography Topical Lecture Week 10
A: Hey B, send me an encoded message. This is how you encode a message for me. Public: Listening to both sides of the conversation! B: Ok. Encodes a message into secret Code, and sends the Coded message. Public Key Cryptography PUBLIC A B
Example • A: Send message to my by code = mesg × 7 • B: OK: The coded message is 8001 • A: Got it. Decodes to mesg = 1147 • BUT all public can do the same. • A: Send message by code = digits 25..30 of sin(mesg). • B: OK: sin(1147) = 0.31331 46634 12474 31144 52706 14928 so code = 14928. • Now Public has no idea how to decode this, BUT • A: Got it. But how do I decode this?
What is A's advantage? • What is different between A and the Public? • Public knows everything that was said by A and B. • Public does not know the secret ingredient that was chosen by A in creating his method of encryption!
One-way and Trap-door • If the function is very difficult to invert, you have a one-way function. • If the function is difficult to invert, unless you know a special secret, it is called a trap-door function. • ANALOGY: I build a house and under one of the floor tiles I hide a trap-door. I know where it is, so I can open it easily. Anyone else can open it, as long as they can find it. They would have to search and try every floor tile.
Public Decryption • Public has enough information to encrypt. • If they can guess the message, they can try to encrypt it. • If it encrypts to the same as the coded message that was sent, problem is solved. • If not, they can try again. • Much like trying every tile in a house.
Nearly Impossible… • It is nearly impossible to try all possible messages. • It would take "forever". • But computers get faster and faster…
Complexity • Computers are fast • But problems are complex • Complexity can be measured • n, n2, n3, … 2n • 2n is enormous • 1, 2, 4, 8, 16, 32, 64, 256, … • Count to 264 = 18,446,744,073,709,551,616 • At 1Ghz = 1,000,000,000 ops/sec • For 1 year = 31,557,600 secs • Will finish counting in 584.54 years
Poly-time and Exp-time • A problem which takes polynomial time to solve, will remain poly-time on any conceivable machine. • A problem that takes exp-time can not be done in polynomial time on any conceivable machine (exception will be mentioned later).
Solving vs Verifying • A problem to find a number x such that … • Is more difficult than • Verify that x solves … • Eg: Find a number x such that x divides 1219335311126371 is a difficult problem. • Verify that 1234577 divides 1219335311126371 is easy.
MCQ Exams • In MCQ exams, I can ask the most difficult question, but students can solve it easily by simply verifying if (a) is the answer, or (b) or (c) or (d) or (e). • If the five choices are not given, the student would have to try all possible answers, which is too hard (called the "brute force" approach). • Eg. Integration is hard, but by differentiation of each of the choices I could solve an integration MCQ.
NP class • Problems that can be verified in polynomial time, can be solved in “at most” exponential time. • Simply verify each possible input • Brute force approach • Many difficult problems have special clever ways to avoid brute force, and give the answer by a special trick.
P = NP ? • The million dollar question. • Do all polynomially verifiable problems have a special trick to make them polynomially solvable? • Or is there any polynomially verifiable problem that always takes exptime to solve?
Factoring thought to be NP • What are two factors of "n" • Given the answer p and q, easy to verify in Polytime. • Can the factoring problem be solved in Polytime? • No one has found a method…yet. • No one has proved it can't be done. • People think it can't be done. • People have been wrong before.
RSA (simplified) • A picks two 100-digit numbers p and q and announces the product n = pq, and a 200-digit random number called e, without revealing p and q. • Tells everyone to send messages to him by encoding Encode(P) = C = Pe mod n. • Number theory tells us that there is a number d, for which Cd = P,
Interplay Between Fields • Security – A serious need felt by businesses and governments Sovled by an interplay between • Mathematics: Number Theory – An ancient discipline, thought to be purely useless. • Computer Science: Complexity – A modern field, gave the impetus to start thinking about trap-door functions. • Quantum Computing – Yet to come, can change the entire equation, by solving exp-time problems in poly-time. Redefines the laws of physics, and hence what is possible and what is not.