5

See here for the man-in-the-middle attack on Diffie-Hellman that I'm concerned about: What is Diffie-Hellman?

How do we combat this? I have two questions:

  1. Is one solution for both Alice and Bob just using a certificate authority, then they can each look up the other's certificate and know the secret key without really communicating (through Eve)?

  2. The other solution I heard about is using RSA for signatures. My question in this case is that, if Alice and Bob are using RSA, why doesn't Alice just send Bob a secret symmetric key using Bob's public RSA key (signed with her private RSA key)? Isn't this basically what PGP does? I don't see the point in using DH if we're using RSA anyway.

otus
  • 32,132
  • 5
  • 70
  • 165
Luke
  • 307
  • 1
  • 3
  • 8

4 Answers4

3

Well, as it says in your link the problem is authentication. So somehow Alice and Bob must set up an authenticated channel. One way of implementing such a channel is by Alice and Bob holding each others public verification key for a signature scheme.

  1. A CA would probably not hold a secret key for Alice and Bob. However, using a CA to get an authentic copy of the other parties public key for a signature scheme that would allow to set up an authenticated channel between Alice and Bob, so they could do DH key exchange. Apart from not trusting the CA with secret information, this has the benefit that Alice and Bob can now generate many secret keys with out involving the CA.

  2. It is true that if Alice has a public encryption key for Bob and Bob has a public signature verification key for Alice, they could use the protocol you describe. However in general public key encryption and signature schemes are not the same(although for the particular instance of RSA there may be some overlap). If Alice and Bob only have keys set up for a signature scheme, they could use DH exchange to get a secret key.

e-sushi
  • 17,891
  • 12
  • 83
  • 229
Guut Boy
  • 2,877
  • 16
  • 25
  • Thanks for your answer. With regards to 1), is this superior to my suggestion purely because you get a fresh session key each time (whereas, in my suggestion, the DH symmetric key would be the same each time)? With regards to 2), again, using DH anew each time is better than my suggestion purely for forward secrecy and, like you say, perhaps it's faster to use a special signature scheme rather than RSA? Basically, is it that everything comes down to using a CA for signatures? – Luke Sep 19 '14 at 12:24
  • It is superior because you could generate as many session keys you like without involving the CA more than once (to get the certificate). It is also superior because the CA would not know any of your session keys.

  • I never mentioned performance, or forward security (both may be a factor but I haven't though about it). You could probably use your suggestion. What I'm saying is that in general you only need a signature scheme and DH key exchange. Your suggestion uses both public key encryption and public key signatures. In a sense you are using more than you generally need.

  • – Guut Boy Sep 19 '14 at 13:05
  • I see. Thanks for your help. Is the reason you don't encrypt the public key in the DH key exchange mainly speed? – Luke Sep 19 '14 at 15:51
  • I am sorry, I dont think I understand the question. Which public key are we talking about now? There is no public key directly involved in DH key exchange. – Guut Boy Sep 19 '14 at 16:06
  • @GuutBoy: actually, while we don't typically call the values $g^a$ and $g^b$ exchanged in the DH key exchange "public keys", it doesn't do violence to the language to call them that, and in fact they are on occasion referred to as public keys. They do share the attributes that we normally expect from "public keys". – poncho Sep 19 '14 at 17:42
  • Oh if that is what you mean by public key, then the reason we do not encrypt it is that there is simply no reason to do it. They are public meaning that they do not need to be kept secret.

    @poncho: Can you elaborate on how they are like public keys, other than being public? Personally I find it misleading (I am not super familiar with DH key exchange though). What can they be seen as public keys for? A PKE? in that case what is the secret key? Surely not the key established by DH key exchange which is clear a symmetric key.

    – Guut Boy Sep 19 '14 at 18:13
  • @GuutBoy: $g^a$ and $g^b$ are 'public keys' in the sense that they allow you to compute some of the operations on the key, but not all. It's clearer when you consider long term DH. As for the corresponding private key, that's $a$ and $b$ – poncho Sep 20 '14 at 14:21