Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

protected by Ninefingers May 24 '12 at 14:44

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

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.