https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key canonical: https://cvsweb.openbsd.org/src/usr.bin/ssh/PROTOCOL.key?annotate=HEAD https://peterlyons.com/problog/2017/12/openssh-ed25519-private-key-file-format/ 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://coolaj86.com/articles/openssh-vs-openssl-key-formats/ https://coolaj86.com/articles/ssh-pubilc-key-fingerprints/ 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 https://github.com/pwnedkeys/openssl-additions/blob/master/lib/openssl/ssh_pkey.rb https://stackoverflow.com/a/25181584/733214 https://crypto.stackexchange.com/a/68732 RSA: d: 512 n: 512 p: 256 q: 256 QInv: 256 d: 4.0.1.3.0 n: 4.0.0.2.0, 4.0.1.2.1.0 (prefix nullbyte) p: 4.0.1.5.0 (prefix nullbyte) q: 4.0.1.6.0 (prefix nullbyte) QInv: 4.0.1.4.0 ## 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)