This is related to the question "After using GenerateAsymmetricKeyPair [], how to print the two keys in hex?" which @Sjoerd Smit kindly answered.

How can I use Mathematica v12.0 to extract the PGP fingerprint from a PGP public key, in 40 hex characters as it usually rendered?

I would like to be able to do this from other people's public keys as well as from public keys (or for that matter private keys, which have the same fingerprint) that I have generated a moment before using GenerateAsymmetricKeyPair[].


1 Answer 1


As far as I can find from a quick Google (but correct me if I'm wrong), the PGP fingerprint is the SHA-1 hash of the key. You can calculated it with:

pair = GenerateAsymmetricKeyPair[]
ToUpperCase @ IntegerString[

On a different note, you can check what's inside the key by using:

List @@ pair["PublicKey"]

It doesn't look like the fingerprint is generated by GenerateAsymmetricKeyPair itself.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.