[tor-dev] ed25519_master_id_public_key -> ed25519 id

Nick Mathewson nickm at torproject.org
Sun Oct 10 15:29:50 UTC 2021


On Sun, Oct 10, 2021 at 8:44 AM nusenu <nusenu-lists at riseup.net> wrote:
>
> Hi,
>
> given a relay's ed25519_master_id_public_key
> file, is there a simple way to generate the
> 43 chars long ed25519 identity string (also found in fingerprint-ed25519)?
>

Yes, there is!

First you verify that the file is really 64 bytes long, and that the
first 32 bytes of the file are really "== ed25519v1-public: type0
==\0\0\0".

Having done that, you base64-encode the second 32 bytes of the file,
with no "=" padding.

I've attached a lazy little python script.

cheers,
-- 
Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ed-key-to-fp.py
Type: text/x-python
Size: 489 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20211010/a5bc7013/attachment.py>


More information about the tor-dev mailing list