How do you decrypt SSH .pcap file that uses Diffie Hellman encryption. With public and private keys
Asked Answered
L

3

11

How do you decrypt SSH .pcap file that uses Diffie Hellman encryption. With public and private keys.

We are trying through Wireshark with no luck.

Loidaloin answered 25/10, 2009 at 23:38 Comment(0)
C
16

One of the benefits of ephemeral Diffie-Hellman (the DHE ciphersuites of TLS) is that it provides perfect forward secrecy. This means that even if the private DSA key used to authenticate the server (and possibly client) are obtained by an attacker someday, she won't be able to go back and decrypt any sessions captured in the past.

In other words, you can't decrypt these captures unless you recorded the secret session key; there's no way to recover it afterward.

This is different than the RSA cipher suites, where knowledge of the server private key allows one to decrypt the session.

Cray answered 26/10, 2009 at 1:48 Comment(2)
If we have the private and public key, can't he decrypt they asynchronous communication and find the session key and then use it to decrypt the rest of the communication?Peeve
@Peeve In ephemeral Diffie-Hellman, you don't have the private key. Another DH key pair is generated for each connection, and kept in memory only for that session. That is the "ephemeral" part of DHE.Cray
U
12

Because the session is encrypted by a transient "session key", having the public/private keys of the server and/or client at the end is of no use to you. Those keys are only used to verify that there has been no man-in-the-middle attack.

In order to decrypt a SSH session, you must either somehow obtain the session key (perhaps by attaching a debugger to a client on either side) or perform a man-in-the-middle attack - this requires the private key of the server (and the client, if key authentication is being used). Some more info on the latter option can be found here: http://taosecurity.blogspot.com/2007/08/loving-ssh.html

Urita answered 26/10, 2009 at 1:3 Comment(0)
C
0

So if I understand well, the process to decrypt a SSH session is very similar to decoding wifi WPA2-PSK, you need to capture the 4-way handshake to be able to derive the transient key aka PTK. In wifi WPA2-PSK if we don't have the 4-way handshake, there is also no way to recover the transient key and decrypt the traffic even if you know the actual passphrase.

Cranston answered 28/4, 2022 at 19:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.