ed25519_master_id_public_key -> ed25519 id

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)? thanks, nusenu -- https://nusenu.github.io

On Sun, Oct 10, 2021 at 8:44 AM nusenu <nusenu-lists@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

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.
thank you for this description, so I can confirm that this: cut -b 33- ed25519_master_id_public_key |base64 gives me the same string as in the file fingerprint-ed25519 kind regards, nusenu -- https://nusenu.github.io

nusenu:
cut -b 33- ed25519_master_id_public_key |base64
hint: don't use this Since cut is line based it will only read until the end of the line but the input file is not a text file - so it will stop reading at random offsets. -- https://nusenu.github.io
participants (2)
-
Nick Mathewson
-
nusenu