Specifically, why are the first 25 characters of ssh Ed25519 public keys always the same?

For example, if I make 5 keys with ssh-keygen -o -a 100 -t ed25519, the first 25 characters are always AAAAC3NzaC1lZDI1NTE5AAAAI.

I assume this is a preamble or header of some sort, but I would love to know the actual answer.

  • 9
    Crossdupe crypto.stackexchange.com/questions/5944/… . New format OpenSSH private key files similarly are the base64 encoding of data that begins with several mostly-constant XDR-formatted strings, although the key type/algorithm is some way in; new format is automatically used for ed25519 (because no old format exists for that type) and you only need to specify -o for other types. – dave_thompson_085 Jan 3 '18 at 10:04

The string is base64 encoded. When decoded, it produces the string \0\0\0\vssh-ed25519\0. This identifies the type of the key. In this case an EdDSA key.

| improve this answer | |
  • 17
    The \0\0\0\v part is 11 written as a 32 bit number and is indicating the length of the string ssh-ed25519. – kasperd Jan 3 '18 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.