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

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


Alternatively, you can use python with openssh-key-parser
(https://pypi.org/project/openssh-key-parser/) as a command line tool,
optionally together with jq (https://jqlang.github.io/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
"aes256-ctr"


More information about the openssh-unix-dev mailing list