[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-talk] onion id calculation



On Sat, Sep 15, 2012 at 11:19 AM, grarpamp <grarpamp@xxxxxxxxx> wrote:
> rend-spec...
> "permanent-id" is the permanent identifier of the hidden service,
> consisting of 80 bits. It can be calculated by computing the hash value
> of the public hidden service key and truncating after the first 80 bits:
>  permanent-id = H(public-key)[:10]
>
> https://trac.torproject.org/projects/tor/wiki/doc/HiddenServiceNames
> To run a hidden service, Tor generates an  RSA-1024 keypair. The .onion
> name is computed as follows: first the  SHA1 hash of the  DER-encoded
> ASN.1 public key is calculated. Afterwards the first half of the hash is
> encoded to  Base32 and the suffix ".onion" is added.
>
> uokvcerylytn3y3p.onion
>
> -----BEGIN RSA PRIVATE KEY-----
[.....]
> -----END RSA PRIVATE KEY-----
>
> openssl rsa -in private_key -pubout -outform DER | sha1 | cut -c 1-10
> python -c "import base64, sys; print
> base64.b32encode(sys.stdin.readline().rstrip('\n')).lower()"
> gu4dsm3cmi3dkyzw
>

based on your private key:

> openssl rsa -in private_key_from_ml -pubout -outform DER | tail -c +23 | sha1sum | head -c 20 | python -c "import base64,sys; print base64.b32encode(sys.stdin.readline().strip('\n').decode('hex')).lower()"
writing RSA key
uokvcerylytn3y3p

look correct to me. Hope this helps,

/marek
_______________________________________________
tor-talk mailing list
tor-talk@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk