Valid onion addresses contain 16 characters in a-z2-7 plus ".onion", and valid auth cookies contain 22 characters in A-Za-z0-9+/.
The regex for the HidServAuth cookie was valuable information to validate setups when I was with SecureDrop and we were using stealth authentication. (looking forward to seeing that land in v3, btw)
Just dropping by to mention that not all combinations of 56-characters long strings of base 32 text are valid v3 onions.
So you can know that it definitely is NOT an onion service name if it doesn't match a simple regex. But you can't know if it definitely IS an onion service name with just regex.
Put simply, a v3 onion address is (1) a 32-byte (not bit) public key, (2) a checksum, and (3) a version all encoded together (in that order) in base32. The version is always 3 (or 'd' in base32), thus they always end in 'd'. In addition, the checksum must work out.
The manual is generated from the tor source repository at tor/doc/tor.1.txt.
Then it's placed on the website.
Would you like to create a patch?
Otherwise, someone else will get to it eventually.
Trac: Description: We have regexes for v1:
^[a-z2-7]{40}\.onion$
and v2:
^[a-z2-7]{16}\.onion$
What do the new addresses look like, do they have the same characters and just 56 of them? This should be in the manual.
to
We have regexes for v1 v3:
^[a-z2-7]{56}\.onion$
where the last digit is always "d".
and v2:
^[a-z2-7]{16}\.onion$
What do the new addresses look like, do they have the same characters and just 56 of them? This should be in the manual, which says:
Valid onion addresses contain 16 characters in a-z2-7 plus ".onion", and valid auth cookies contain 22 characters in A-Za-z0-9+/.
Summary: Publish regex for v3 hidden services to Summarise the format of v3 hidden service addresses in the Tor man page Type: enhancement to defect Keywords: regex, hidden services, v3, next-generation deleted, prop224, tor-doc, tor-hs added Milestone: N/Ato Tor: 0.3.4.x-final Version: Tor: unspecified to Tor: 0.3.2.1-alpha Component: Webpages to Core Tor/Tor Points: N/Ato 0.1