How can I get the symmetric encryption key used by SSH?

1

I'm looking into a Wireshark trace made by myself, and I wanted to see what the client sent to the server and what the server replied in the encrypted application data stream. While I see what method was used for encryption (ChaCha), I obviously can't see the symmetric encryption key, which was negotiated using Diffie Hellman.

Is there an option for ssh or sshd to print or log the secret key used in the symmetric cipher?

Johannes Schaub - litb

Posted 2016-05-28T15:44:01.267

Reputation: 321

Answers

0

No. You would have to recompile openssh to get this information from the client. All the keys are derived in kex.c.

Note that there are 6 of them derived from the shared secret, 2 IV, 2 for encryption and 2 for MAC (different for both directions).

Jakuje

Posted 2016-05-28T15:44:01.267

Reputation: 7 981