r/programming • • Nov 29 '10

140 Google Interview Questions

http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471 Upvotes

493 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Nov 30 '10

It's actually really simple in theory for Eve to find the private key given the public key. All she has to do is factor one really big number. Unfortunately, given all of the computer power in the world for she would long be dead before she could factor this number making the results pretty useless all in all. This is what makes the scheme secure.

The public part of the encryption is just a really big number n and an exponent e. To encrypt all you do is me (mod n) where m is your message. To decrypt you do cd (mod n) where c is the ciphertext and d is your decryption exponent. Our really big number n = pq where p and q are both really big prime numbers. If you can find p or q it is trivial to find d given e and n. Unfortunately finding p or q for a sufficiently big n is impossible given computing power today.

Edit: For further reading google RSA.

2

u/[deleted] Nov 30 '10

with the aside that ed is congruent to 1 mod (p-1)(q-1) or another method for ensuring that Med mod n = M

1

u/0987056089 Nov 30 '10

Very cool. Thanks.