SSH private keys: passphrase testing
Extract a private key to a John-compatible hash and recognise an encrypted key header.
A passphrase-protected private key can be converted to a hash and tested offline. A key without protection yields no candidate.
ssh2john <Private Key> > /tmp/tocrack
john /tmp/tocrack -wordlist=/usr/share/wordlists/rockyou.txtFor legacy PEM keys, the following header indicates encryption. Modern OpenSSH keys use the same outer header whether encrypted or not, so the header alone is not a general passphrase test:
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTEDProvenance and confidence
- Version
- 2
- Sources reviewed
- 2026-11-23
- Confidence
- medium — Legacy RTFM; v2 editorial review on 2026-11-23 limits the header-based encryption test to legacy PEM. No key recovery performed.
Also searched as: clé ssh, passphrase ssh, ssh2john, private key, cassage de clé ssh