Could you please explain what the pipe (|) in tor specification means -- is it a bitwise or or a concatenation of the values?

  1. Encoding onion addresses [ONIONADDRESS]

    The onion address of a hidden service includes its identity public key, a version field and a basic checksum. All this information is then base32 encoded as shown below:

    onion_address = base32(PUBKEY | CHECKSUM | VERSION) + ".onion"

    CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2]


    • PUBKEY is the 32 bytes ed25519 master pubkey of the hidden service.
    • VERSION is an one byte version field (default value '\x03')
    • ".onion checksum" is a constant string
    • CHECKSUM is truncated to two bytes before inserting it in onion_address

From the context, I understand it is a concatenation-- is that so?

If one has a working short Python\Node\Ruby snippet for that, it would be lovely. :)


closed as off-topic by forest, Maeher, AleksanderRas, kelalaka, Maarten Bodewes Jul 11 at 9:58

  • This question does not appear to be about cryptography within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    $\begingroup$ I'm voting to close this question as off-topic because it is not related to cryptography, but to the meaning of symbols in the technical specifications for a cryptographic tool. $\endgroup$ – forest Jul 6 at 22:50
  • $\begingroup$ Putting this on hold, Mr. The meaning of the symbol | depends on context, in this case Tor. Such questions are not related to cryptography but to the protocol in question. $\endgroup$ – Maarten Bodewes Jul 11 at 9:57

As you suspect, it's a concatenation symbol. Some times it's $|$ and others $||$. Or $+$. Python and PL/SQL examples to confirm. Or a cryptographic example: bottom of page 5 of FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions.

If it were bitwise OR, you'd make a real mess of the public key's use with PUBKEY | CHECKSUM | VERSION.

It can get weird though if you dig deeper as: Is there a common symbol for concatenating two (finite) sequences?

  • $\begingroup$ thank you. have you got any example\tutorial on how to generate onion address v3 (hostname) on linux command line? $\endgroup$ – Mr. Jul 6 at 14:03
  • $\begingroup$ @Mr. Alas, no :-( $\endgroup$ – Paul Uszak Jul 11 at 11:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.