Do you like reading complicated mysteries, locked room puzzles? Maybe writing them?
I have just the puzzle for you.
Bob needs to send vital files back to Alice, his boss, at the Department of Saving the Earth. These files contain the secret plans the evil aliens have hatched to take over the Earth, including the fact that Mallory has become a traitor, turning the Earth’s defenses over to the aliens in exchange for a beach house in the Hamptons. Mallory, using the powers of the evil aliens, can intercept messages Bob sends, and even inject messages of his own. Bob can’t risk revealing that he’s onto Mallory and the aliens’ evil schemes.
How does Bob send the files to Alice in a way that Mallory can’t read what he’s sending and Alice can be sure that it was Bob who sent them?
It doesn’t sound too hard. Bob encrypts the files and now Mallory, whose code breaking prowess is a little lacking–he skipped those classes in Secret Agent school–can’t read the file.
Bob can use the super-secure file transfer program on his laptop to encrypt the file. The file transfer program back at Headquarters will decrypt the file and put it into Bob’s Really Important Things folder. Alice will see it there and save the world.
Bob’s super-secure file transfer program creates a cryptographic signature– a computation, using the secret key that exists only on Bob’s laptop–and the super-secure file transfer program back at Headquarters will check that signature, proving that it came from Bob, and using Bob’s ID, verified with the signature, store the file in the Bob’s Really Important Things folder.
But Bob’s super-secure file transfer program gives him two options–and here is the puzzle you have to help him solve–
A) It can create a digital signature of the original file, then encrypt the file, and then send both of those things to Headquarters (along with Bob’s ID so that the e-mail program can look up the correct keys to use to do the decrypting and signture checking).
B) Encrypt the file, then create a digital signature of the encrypted file, and send both of those to Headquarters (along with Bob’s ID so that the e-mail program can look up the correct keys to use to do the decrypting and signture checking).
Which should he do? Can Bob save the world with either of these methods? Mallory can intercept and manipulate the messages, but he can’t read them…
Time’s running out on Bob, should he choose A or B? (No fair calling Alice on the phone and shouting “RUN!”)