https://peterlyons.com/problog/2017/12/openssh-ed25519-private-key-file-format/ https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key canonical: https://cvsweb.openbsd.org/src/usr.bin/ssh/PROTOCOL.key?annotate=HEAD https://stackoverflow.com/a/56300901/733214 https://stackoverflow.com/a/59283692/733214 https://coolaj86.com/articles/the-openssh-private-key-format/ https://coolaj86.com/articles/the-ssh-public-key-format/ https://crypto.stackexchange.com/a/40910 https://flak.tedunangst.com/post/new-openssh-key-format-and-bcrypt-pbkdf ("(Technical note: PBKDF2, aka PKCS #5, supports pluggable hash functions, though in practice everybody uses HMAC-SHA1. The bcrypt pbkdf essentially is PBKDF2, but with bcrypt plugged into it instead.)" http://www.tedunangst.com/flak/post/bcrypt-pbkdf https://xorhash.gitlab.io/xhblog/0010.html https://blog.rebased.pl/2020/02/10/ssh-key-internals.html https://blog.rebased.pl/2020/03/24/basic-key-security.html ## UPSTREAM https://github.com/openssh/openssh-portable/blob/master/sshkey.c funcs: sshkey_generate (~L1714) sshkey_private_to_blob2 (~L3833) sshkey_private_to_fileblob (~L4413) https://github.com/openssh/openssh-portable/blob/master/cipher.c funcs: cipher_ivlen https://github.com/openssh/openssh-portable/blob/master/ed25519.c funcs: crypto_sign_ed25519_keypair (~L26) https://github.com/openssh/openssh-portable/blob/master/authfile.c funcs: sshkey_save_private (~L68) sshkey_save_private_blob (~L56) https://github.com/openssh/openssh-portable/blob/master/ssh-keygen.c funcs: main (~L3145; ~L3673 onwards for key generation)