Check a key's fingerprint
A fingerprint is a short summary of a public key that two people can compare by eye or read aloud. On SecureSecretStore it is 8 groups of 4 characters, like this:
05c6 f091 667b d9bc caf0 bd0a 496d 871d
Why check a fingerprint at all?
When you share a secret, your device encrypts it to the public key of each reader. If the public key you were given is not really theirs, you encrypt to whoever owns the key you were handed. A hostile or compromised server could do that swap, and so could anyone who can change a message on its way to you.
Comparing fingerprints with the key's owner, over a channel the server does not control, closes that gap. A video call, a phone call, or a message in a chat you already trust all work. The free tool and the apps compute the fingerprint on your own device, so the comparison does not depend on our server's answer. The script below is short enough to read and needs only Python's standard library, so the check needs no code served by our site.
How do I check a key with the free tool?
- Open the free key tools on the home page and choose Check a key's fingerprint.
- Paste a public key. It starts with
age1. - The tool says whether the key is valid and shows its fingerprint.
The check runs entirely in your browser. Nothing you paste is sent anywhere. If you paste a secret key by mistake
(one that starts with AGE-SECRET-KEY-), the tool refuses it on your device with "This is a secret key. Never paste
it into a website." If that happens, treat the key as exposed anyway if it was in a shared clipboard or screen
recording, and make a new one.
A key is valid when it decodes cleanly: the right prefix, lowercase, only the allowed characters, a correct checksum, and exactly 32 bytes of key. Together the checksum and the length check catch a mistyped or truncated key, so a key copied with a character missing fails instead of producing a wrong fingerprint.
How is the fingerprint computed?
The fingerprint is the first 16 bytes of the SHA-256 hash of the 32-byte X25519 public key, written as 8 groups of 4
lowercase hex characters. The age1… text is a Bech32
encoding of those 32 bytes, as the age specification defines.
You can compute it yourself, with no network and no extra packages, using this Python script:
#!/usr/bin/env python3
"""Print the fingerprint of an age X25519 public key (age1...).
Fingerprint: the first 16 bytes of SHA-256 over the 32-byte key,
as 8 groups of 4 lowercase hex characters.
"""
import hashlib
import sys
CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
def polymod(values):
gen = [0x3B6A57B2, 0x26508E6D, 0x1EA119FA, 0x3D4233DD, 0x2A1462B3]
chk = 1
for v in values:
top = chk >> 25
chk = (chk & 0x1FFFFFF) << 5 ^ v
for i in range(5):
if (top >> i) & 1:
chk ^= gen[i]
return chk
def decode_age_public_key(key):
if key != key.lower():
raise ValueError("age public keys are written in lowercase")
hrp, _, data = key.rpartition("1")
if hrp != "age":
raise ValueError("not an age X25519 public key (age1...)")
if any(c not in CHARSET for c in data) or len(data) < 7:
raise ValueError("bad characters")
values = [CHARSET.index(c) for c in data]
expanded = [ord(c) >> 5 for c in hrp] + [0] + [ord(c) & 31 for c in hrp]
if polymod(expanded + values) != 1:
raise ValueError("checksum does not match: a character is wrong")
acc, bits, out = 0, 0, bytearray()
for v in values[:-6]:
acc = (acc << 5) | v
bits += 5
if bits >= 8:
bits -= 8
out.append((acc >> bits) & 0xFF)
if bits >= 5 or (acc & ((1 << bits) - 1)):
raise ValueError("bad padding")
if len(out) != 32:
raise ValueError("wrong length for an X25519 key")
return bytes(out)
def fingerprint(key):
digest = hashlib.sha256(decode_age_public_key(key)).hexdigest()[:32]
return " ".join(digest[i:i + 4] for i in range(0, 32, 4))
if __name__ == "__main__":
for arg in sys.argv[1:]:
try:
print(fingerprint(arg.strip()))
except ValueError as err:
sys.exit(f"invalid: {err}")
Save it as age-fingerprint.py and run it on a key:
$ python3 age-fingerprint.py age1zclk3f7hzjsdzxdp7flytqdjz5ltyjfu34mcphjr9fsa2vxyq3hsjyech8
05c6 f091 667b d9bc caf0 bd0a 496d 871d
Change the last character of that key and the checksum catches it:
$ python3 age-fingerprint.py age1zclk3f7hzjsdzxdp7flytqdjz5ltyjfu34mcphjr9fsa2vxyq3hsjyech9
invalid: checksum does not match: a character is wrong
To get the public key from your own identity file first, use age-keygen -y:
python3 age-fingerprint.py "$(age-keygen -y key.txt)"
The script handles classic X25519 keys only. A post-quantum key, which starts with age1pq1, is a different kind of
key, and the script reports it as not an age1… X25519 key.
How do I compare a fingerprint with someone?
- Use a second channel. Ask the person to read their fingerprint from their own device, on a call or in a chat you already trust. Do not compare it against a copy that came from the same place as the key.
- Compare every group. Read all 8 groups, not the first and last. Someone who can generate many keys can make one whose ends match.
- Do it once per device. Each of a person's devices has its own key and its own fingerprint, so a teammate with a laptop and a phone has two to check.
- For an agent, compare the fingerprint the agent's runtime printed when it made its key with the one shown on the site. Whoever set up the runtime can read it from the runtime's logs or setup output.
What do "new key" and "key changed" warnings mean?
SecureSecretStore is not open yet. When it opens, its apps remember each key's fingerprint the first time they see it, and warn when it changes. A new device for a teammate is normal, and so is a changed key after a device is replaced. An unexplained change is not. Until you have compared the new fingerprint with its owner, do not share anything with that key.
For the reasons behind this check, see How the encryption works.
For agents and tools: llms.txt. AI version of this page.