I have a Pcap file that contains some SSH encrypted packets. I have the server public and private key. How do I decrypt these private keys? Is it possible to get the session key using Wireshark or some other software?

  • 1
    Decrypting the private keys requires the password for the private keys. Decrypting the session to get the session keys requires decrypting the private key. – RoraΖ Oct 14 '15 at 13:41

I'm not sure what you mean by: "How do I decrypt these private keys?". Well, they are not encrypted. Maybe (and I'm not sure if it is even possible), they could be somehow encrypted by a password, but AFAIK they are not. Admin would have to enter the password on every sshd startup which would be annoying.

SSH protocol uses Diffie-Hellman algorithm to exchange an encryption key. The server private key is used just to sign (not encrypt!) the handshake to prove the server authenticity.

So, even if you manage to obtain the server keys, you won't be able to decrypt a recorded session. You would be just able to fake the server identity.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.