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.

How to generate a session key between two nodes in two different subnets when the nodes don't know each other directly, using diffie hellman algorithm?

share|improve this question
To generate a key, the nodes don't have to know each other, there just has to be a way of transferring messages between them. To do this securely, you also need some authentication, though. Where exactly is your problem? –  Paŭlo Ebermann May 20 '12 at 20:17
Sorry, it is still not clear what you want. Please read an description of the Diffie-Hellman protocol (e.g. in Wikipedia), and then tell us which part of this doesn't work in your case. Also note that you can edit your question, which is often more readable than in a comment. –  Paŭlo Ebermann May 21 '12 at 18:24
add comment

1 Answer

If the nodes can send messages to each other ( via any number of hops/ intermediate nodes) then you can do straight standard diffie-hellmen even if they don't have a prior relationship. Indeed, thats the point of diffie-hellmen.

However, any one of the intermediate nodes could launch a man in the middle attack and could then impersonate either node to the other. There is no way to stop this if the nodes actually don't know anything about eachother. If they do know each other, you can used authenticated diffie-helmen key exchange or a public key crypto system. Agian, these only work if the nodes know each other's public key before hand.

share|improve this answer
add comment

protected by Ninefingers May 24 '12 at 14:44

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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