[tor-talk] HiddenServices: calculating .onion address with private key?

shupert1 shupert1 at privatdemail.net
Fri Aug 31 07:41:08 UTC 2012


Hi,

I found a short info (somewhere on Tor's GitHub account) about
"calculating" .onion address when I have private key but I was not able
to implement a short code example with perl/php/bash.

I know I could just throw the private key in
/var/lib/tor/my_hidden_folder and let Tor do job but I would like to
calculate
this without Tor.

I tried something like this on the shell but the result is always wrong:


$ openssl rsa -outform DER -in "private.key.file" 2>/dev/null  | \
sha1sum -b | awk '{ print $1 }' | head -c 20 | \
perl -MMIME::Base32=RFC -e 'print lc(MIME::Base32::encode(<STDIN>))' |\
head -c 16


Someone smarter with a better idea?

Thanks


More information about the tor-talk mailing list