When generating a tor address domain and keys the secret key must be additionally "expanded":

Is it possible to explain in simple words why the expansion is needed? I have no background in Cryptography but maybe there is some simple explanation.

I just generated an ed25519 key and stored as hs_ed25519_secret_key with == ed25519v1-secret: type0 ==\x00\x00\x00 prefix and to my surprise it worked in Tor and I was able to open the self generated onion service.

So now I'm confused what is the purpose of the expansion?

The Tor generated (extracted) public key and created the hostname file with an onion address. So as far I understood the pubkey is simply not needed and asked here.

Another one question is why the checksum generation is so complicated? We should make sha3 from concatenation of ".onion checksum" (?) and version (?). But take only 2 bytes of the hash.

I can't understand why the checksum was choose. It's difficult to generate and verify. Does the Tor browser or anyone verifies the checksum? Why we can't just use Luhn algorithm or ISIN, IBAN etc. Here I don't see why the cryptographic digest hash was used and anyway most its calculated bytes are dropped and only two are used.

My end goal is to generate an onion domain in plain shell script from an OpenWrt router and each step is a pain. The sha3 is missing there but md5sum and sha256sum are available out of the box. E.g. Luhn would be difficult to implement anyway but some less advanced hash might simplify my job.


You must log in to answer this question.

Browse other questions tagged .