Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

I am trying to design MiTM protected key exchange algorithm. For instance I am using RSA asymmetric keys.

Alice and Bob respectively have each their own pair of keys. And they should be able to exchange public keys. In real life implementation there would be a relay 3rd party which should only allow Alice and Bob exchange messages in case if there is no way for direct connection. However this relay party can be compromised by Eve where she would have her own pair of keys, accept Alices And Bobs public keys during the exchange and send out hers instead. Therefore all encrypted messages will be decrypted, read, encrypted again and sent further by Eve compromising the whole key exchange process.

Apparently there can be Trent that could sign the key before it is sent to the recipient and later after it has been received could verify the signature. However I feel that this schema also has a flaw as Eve could somehow obtain public key signed by Trent.

Is there a way to make sure that if Trent is not compromised (means that it is not someone disguised as Trent) we can make sure that keys are exchanged securely?

What comes to mind is that any party can have information about Trent (certificate, public key or something similar) using which they can make sure they communicate with Trent, whereas Trent would confirm to each party from whom they received the key. Does this schema has a flaw or any issues that I haven't noticed?

share|improve this question
    
    
@GalacticJello Hardly. Things described there are pretty much basic theory which I know already. The case I am talking about is not when Eve listens to messages between Alice and Bob, but when Eve replaces their messages with her own, therefore simple exchange of asymmetric keys or DH will not work because each side (Alice and Bob) will think that their message received by another (Bob or Alice respectively), but in fact all messages are received by Eve and replaced with her desired messages. Therefore whole DH isn't working here and there should be some other way around this issue. –  AlexKey Sep 5 '13 at 4:48
    
I was hoping that the part where the authentication happens before the key exchange would be relevant. How about this? Provably-Secure Authenticated Group Diffie-Hellman Key Exchange –  GalacticJello Sep 5 '13 at 15:29
add comment

1 Answer

up vote 1 down vote accepted

You are right that the session public keys can be replaced if they are not signed by long term private key known to all parties.

What you want to do is not have Trent do anything but be a relay, then you need a standard key exchange process between the two parties using new random key pairs. Then once all parties have both public keys, they can generate an authentication hash of the key pairs as well as the prime/exponent and any other common data. After the key exchange completes and the session key is generated, you would need some way to compare them, even if it is an insecure channel, as long as that comparison cannot be modified.

Several programs use this method or one like it. I use one over IRC, with the IRC server taking the place of Trent. The obvious alternative is known long term keys that are only used for signing the session public keys.

share|improve this answer
    
long term keys can be asymmetric for signing or symmetric for authentication, to be a little more clear. Digital signature functionality may not be available, but an authentication routine using block ciphers or hash algorithms can be built easily –  Richie Frame Sep 4 '13 at 8:25
    
Could you maybe go a little bit more into details of such an exchange? I am quite new to cryptography with more of exact implementation experience rather than theory. In my understanding when we talk about trusted Trent that means we supply to each party digital entity capable of proving identity of Trent (public key, certificate or similar). If we have it, then Trent can act as trusted 3rd party signing Bobs public key before it is sent to Alice where as signature should be a prove of who is the sender, thus if there is MiTM then the key can't be replaced. –  AlexKey Sep 4 '13 at 8:45
    
The channel between Trent and the other parties can also be intercepted or tapped, therefore signing and authentication should occur before the data reaches the network adapter. If you are able to prove to Trent your identity, you should be able to do so to the other party. Trent can always be replaced. –  Richie Frame Sep 4 '13 at 16:51
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.