Expand description
A server key’s fingerprint: a short code a person can compare between the server’s terminal and a client’s screen before the client pins the key.
SHA-256 over a fixed label and the 32-byte EndpointId, the first 80
bits, in Crockford base32, as four groups of four: K7QX-3MPA-9TRD-WF2H.
80 bits puts making a key with a given fingerprint out of reach; a
six-digit code could be matched by generating keys for a few seconds.
Crockford’s alphabet has no I, L, O or U, so the code reads aloud
without confusion. The server and every client compute it here, so they
always agree.
Constants§
- TEST_
VECTORS - Keys and their fingerprints, computed apart from this code (Python’s hashlib), so the format cannot drift. The server’s and the SDK’s tests check them too.
Functions§
- fingerprint
- The fingerprint of the
EndpointIdwhose 32 bytes arekey. - of_hex
- The fingerprint of an
EndpointIdwritten as iroh prints it (64 hex digits);Noneif it is not one. - parse
- A fingerprint as a person typed it, read back from another screen or
aloud: in the form
fingerprintwrites it, orNoneif it is not one. Case, spaces and dashes do not matter, and the letters Crockford reads as digits are read so (Oas0,IandLas1); anything else, and any length but sixteen characters, is not a fingerprint.