Diffie-Hellman combined with DSA/RSA

we have learned Diffie-Hellman, RSA and DSA (Digital Signature Algorithm) in university.

Because DH is vulnerable of Man-in-the-Middle we had the task to program the DH combined with RSA to protect it against MitM. Now I have seen an earlier exam, in which the prof asked to construct a procedure with DSA to protect DH against MitM.

How is this possible? I have really no idea how I can use DSA to protect DH against MitM. Anyone of you can help me?

• Hint: how did you use RSA to protect the DH exchange? How could you use DSA to do that exact same thing? Jun 19 '16 at 17:26
• I created a public key and gave it to the other device. It encrypted the prime and the generator so that only I could decrypt it. But isn't DSA only for signing messages/hashes or does it have a public/private infrastructure too? Jun 19 '16 at 18:16
• For the public/private infrastructure: y (g^x mod p) is the public key. x is the private key. Should I encrypt the message now with y and decrypt it with x? But then it has nearly nothing to do with the DSA. I think I'm a blockhead. Jun 19 '16 at 18:30
• Okay I hope I got it. Is this right? y is the public Key and is depending on x, p, q, h and so on. x is the private Key. So it is the same like RSA. Encrypting with the public key and decrypting it with x. But the DSA is not really made for this as RSA is made for signing and encrypting isn't it? Jun 19 '16 at 18:42
• @poncho Ok last try I think this is the solution: I signate all my data exchanged with DH. I give the other person my public key face-to-face so that he can trust me. The a MitM can read all exchanged data, but he has no chance to change it (because the signature would not fit to the message anymore). So after all is exchanged and the symmetric key is generated he has no chance to read anything anymore. Is that finally right? Jun 19 '16 at 19:33