How to determine which cipher was used to encrypt OpenSSH private keys

Joost van Dijk vandijk.joost at
Thu Jan 25 03:24:05 AEDT 2024

Alternatively, you can use python with openssh-key-parser
( as a command line tool,
optionally together with jq ( to query
the resulting JSON:

$ pip install openssh-key-parser
$ ssh-keygen -t rsa -N secret_passphrase -C my_comment -f test_id_rsa
$ python -m openssh_key test_id_rsa --passphrase secret_passphrase |
jq .header.cipher

More information about the openssh-unix-dev mailing list