Check an SSH Key's Fingerprint, Type and Size KEYPRINT
Paste a public key, a whole authorized_keys file or known_hosts lines and see each key's fingerprint as ssh-keygen prints it, its type and size, and what is wrong with it.
The keys
Public keys only. A private key pasted here by mistake is recognised and not read.
What is wrong, if anything
Each key
What a fingerprint is, and why check one
An SSH key is a long run of base64 nobody compares by eye. Its fingerprint
is a hash of the key, short enough to read out over the phone: what
ssh-keygen -l prints, what GitHub and GitLab show beside every
key on an account, and what SSH asks you to confirm the first time you connect
to a server. Checking that two fingerprints match is how you know the key on
the server is the one on the laptop, or that the host you are connecting to is
the host its owner says.
KEYPRINT computes the fingerprint from the key itself, in both forms still in use: SHA256, the base64 one current OpenSSH prints, and MD5, the colon-separated hex that older systems and some control panels still show. It reads the key's wire format to give its real type and size, rather than trusting the label in front of it.
Auditing an authorized_keys file
An authorized_keys file is the list of every key that can log in as that
account, and on long-lived servers it collects keys nobody can put a name to.
Paste the whole file. Each line is read with its options (from=,
command=, no-pty, restrict), and the page
flags what should go:
- DSA keys, which OpenSSH stopped accepting by default in 2015.
- RSA keys under 2048 bits.
- The same key twice, often under two different comments, which usually means a key meant to be removed was relabelled instead.
- Keys the text says are one type and the data says are another.
Certificates, known_hosts and the rest
OpenSSH certificates are read in full: user or host, key ID, serial,
principals, the validity window, critical options, extensions, and the
fingerprint of the CA that signed them. A certificate with no principals is
flagged, because OpenSSH treats it as valid for any user, and so is one that
never expires or was signed with SHA-1. known_hosts lines are read with their
host lists, including hashed entries and @cert-authority and
@revoked markers, and keys exported in the RFC 4716 format that
PuTTY and some commercial SSH products write are read too.
Everything is computed in this tab; nothing is sent. For a TLS certificate rather than an SSH key, CERTLENS takes it apart. To make a new key pair in the browser, KEYRING makes an age key, and SENTINEL finds private keys left in files before they are shared.
Questions people ask about KEYPRINT
How do I check an SSH key's fingerprint?
Paste the public key (the line in the .pub file) here and KEYPRINT shows its SHA256 fingerprint exactly as ssh-keygen -lf key.pub prints it, and the MD5 form with -E md5. Compare it with the fingerprint GitHub, GitLab or your hosting provider shows.
What is the difference between the SHA256 and MD5 fingerprints?
They are two hashes of the same key. OpenSSH has printed SHA256, in base64, since version 6.8 in 2015; before that it printed MD5 as colon-separated hex, and some systems still show that form. Both identify the same key; they just cannot be compared with each other.
Is it safe to paste my key here?
A public key is meant to be shared, and nothing leaves the tab anyway. Never paste a private key anywhere; if one is pasted here by mistake, KEYPRINT recognises it, does not read it, and clears it from the box.
Why is my DSA key flagged?
OpenSSH disabled DSA keys by default in version 7.0, in 2015, because they are limited to 1024 bits and fail badly if the random number generator is weak. Replace it with an Ed25519 key: ssh-keygen -t ed25519.
What does a certificate with no principals mean?
An OpenSSH user certificate lists the user names it may log in as. With none listed, OpenSSH accepts it for any user on any server that trusts the CA, which is almost never what was meant.
Can it read hashed known_hosts entries?
It reads the key and its fingerprint. The host names are hashed on purpose so that a stolen known_hosts file does not list the servers you connect to, so they cannot be read back.
Worth reading first
Related tools
- CERTLENSTake a certificate or a chain apart and check it
- KEYRINGMake an age key pair and encrypt files to one
- SENTINELFind keys, passwords and card numbers before you share
- ENVSHIELDHide secrets before you share a config file
- SWEEPRead an Nmap scan, and see what changed since the last one
- CHECKSUMVerify a download was not tampered with