Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I'm trying to code up a encrypted communication program. Originally I was thinking that I would use public key cryptography and then I would keep the public keys in a database where users could query the database for another user's public key to encrypt their message. However this allows me to read their message if I ever sent them my public key instead of the their intended recipient's public key.

Is it possible to have forward secrecy if they grab the public key from the central server, which I control? It seems to me that if you use some forward secrecy algorithms like STS I would still be able to send both users my public key and they would be none the wiser.

share|improve this question
add comment

migrated from crypto.stackexchange.com Jun 18 '13 at 8:31

This question came from our site for software developers, mathematicians and others interested in cryptography.

1 Answer

It's not possible to exchange public keys over an untrusted channel without the help of a trusted third-party. Even STS assumes that either: a) the public keys were exchanged in advance; or b) certificates are used to help establish key trust (so either a CA, Web of Trust or similar is needed). In your scenario, you're acting as the trusted third-party, asserting to each user that a given key belongs to him/her, and that you're not secretly performing a man-in-the-middle attack (sometimes called institutional MitM). In other words, you're correct in your assumptions.

I'd suggest looking at this answer for some insights on the subject of public key trust. I'm afraid there's little I can suggest you in order to improve over the existing models though...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.