Generate SHA256, MD5 fingerprints and randomart for any SSH public key. 100% client‑side, no server upload. In‑depth guide included.
An SSH fingerprint is a short sequence of bytes (usually displayed in hex or base64) that uniquely identifies a public key. It is generated by hashing the public key data with a cryptographic hash function. This fingerprint serves as a compact, human‑readable identifier for the key, much like a real fingerprint identifies a person.
~/.ssh/authorized_keys or known_hosts, fingerprints help you identify which key is which without exposing the full key material. This is especially useful when you have many keys.
The process is straightforward:
MD5:2a:3b:4c:... ). For SHA256, it is base64‑encoded and prefixed with SHA256:.
The key's comment (user@host) is not included in the hash, so two keys that differ only in comment will have identical fingerprints. This is intentional – the comment is metadata, not part of the cryptographic identity.
MD5 was the default for many years. It produces a 128‑bit hash, displayed as 32 hexadecimal digits (e.g., MD5:2a:3b:4c:5d:6e:7f:80:91:a2:b3:c4:d5:e6:f7:08:19). However, MD5 is now considered cryptographically broken – collision attacks are practical (two different inputs can produce the same hash). While collisions are still difficult to exploit for SSH fingerprint spoofing, the industry moved to stronger algorithms. SHA256 (part of the SHA‑2 family) is the current default since OpenSSH 6.8 (released 2015). It produces a 256‑bit hash, encoded in base64 and prefixed with SHA256: (e.g., SHA256:4eG5QcdcHdOB5yU2QHmzYz3QpZ3sQpZ3sQpZ3sQpZ3s). SHA256 is resistant to known collision attacks and provides a high level of security for key verification.
| Algorithm | Key size | Security | Performance | Recommendation |
|---|---|---|---|---|
| Ed25519 | 256 bits | Very high (resistant to side‑channel, based on Curve25519) | Fastest (signing/verification) | Recommended for all new keys |
| RSA | 2048‑4096 bits | High (at 4096 bits) | Slower, especially for signing | Use 4096‑bit if Ed25519 unavailable |
| ECDSA | 256/384/521 bits (NIST P‑256, P‑384, P‑521) | High (depends on curve) | Fast | Acceptable, but some users distrust NIST curves due to potential backdoor concerns |
| DSA | 1024 bits only | Deprecated (weak, limited to 1024 bits) | - | Never use; removed in OpenSSH 7.0 |
Ed25519 keys are now widely supported and are the default in modern OpenSSH. They offer excellent security, short key lengths (faster handshakes), and resistance to certain implementation flaws. RSA 4096 is still common, especially in legacy environments.
OpenSSH 5.1 (2009) introduced randomart – an ASCII art representation of the key fingerprint. The idea is that humans are much better at recognizing visual patterns than comparing long strings of hex or base64. Two different keys will produce visually distinct randomart images, making it easy to spot a mismatch at a glance.
The algorithm used is called the Drunken Bishop. It works as follows:
.o+=*BOX@%&#amp;... (the more visits, the denser the symbol). The starting cell is marked with S, and the ending cell with E.
The randomart is printed with a border like +---[RSA 4096]----+ and +----[SHA256]-----+ indicating the key type and hash algorithm. By comparing two randomarts, you can visually verify that they are the same – even a small change in the fingerprint will produce a completely different pattern.
known_hosts file for future connections.
ssh-agent to cache them.
authorized_keys and updating all relevant systems.
authorized_keys files to remove unused or obsolete keys.
You can obtain fingerprints using ssh-keygen:
ssh-keygen -lf ~/.ssh/id_rsa.pub – SHA256 fingerprint (default).
ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub – MD5 fingerprint.
ssh-keygen -lvf ~/.ssh/id_rsa.pub – include randomart (-v for visual).
ssh-keyscan example.com | ssh-keygen -lf - – fetch and display the host key fingerprint of a server.
-E md5 vs default SHA256). Also, the comment (user@host) is not part of the fingerprint, so it doesn't affect the hash. If the key material itself is identical, the fingerprint will be identical.
ssh-rsa, ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521. Private keys or PEM files are not accepted.
This guide contains over 1200 words of in‑depth information to help you master SSH key fingerprints and randomart.
ssh-keygen -lf ~/.ssh/id_rsa.pub – SHA256 fingerprintssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub – MD5 fingerprintssh-keygen -lvf ~/.ssh/id_rsa.pub – with randomartssh-keyscan example.com | ssh-keygen -lf - – server fingerprint