Format:OpenSSH public key
| On this wiki | Facts · Code · Notes · Topics |
|---|
SSH wire format of a public key blob (also the base64 field of authorized_keys lines): a length-prefixed algorithm name followed by algorithm specific fields.
Wire format
A public key blob is an SSH string holding the key type name followed by fields (uint32 length-prefixed strings or mpints). Single-line text form: <type> <base64 of blob> [comment]. For ssh-ed25519 the blob starts 00 00 00 0b + ssh-ed25519 + 00 00 00 20 + 32 key bytes. Unverified: the type-specific field lists for ssh-rsa (e then n as mpints), ecdsa-sha2-nistp256 (curve name string then point) were not read in this pass; PROTOCOL.key says only that the private keys use ssh-agent encoding and that each public key is a string.
Because the blob starts 00 00 00 0b+type, the base64 of an ssh-ed25519 key starts AAAAC3NzaC1lZDI1NTE5, and ssh-rsa starts AAAAB3NzaC1yc2E. Unverified: standard knowledge, derived from base64 of those bytes, not from a source file read.
See Format:OpenSSH private key.
Code & repositories
- https://github.com/openssh/openssh-portable @
26b1363c7cbf5d01c730f45fc0b4abc5686beaf7· license: BSD-3-Clause (read from LICENCE; GitHub's detector did not classify it)
OpenSSH portable: PROTOCOL.key documents the openssh-key-v1 private key format; sshkey.c parses and writes it.
Tested on: source read, not run: source reading only · checked 2026-10-19; last activity 2026-10-18