Guides on system administration, 3D printing and other technology related projects.

Generate a Vanity .onion Tor Address

Generate a Vanity .onion Tor Address

In order to access a hidden service on the Tor network, you’ll need to navigate to the special .onion address for it.

An onion address and public/private keypair will be generated for you when you install Tor onto your computer. However it’s still possible for you to have your own vanity .onion address. You can do this by generating massive amounts of hashes and searching for a specific prefix.

Facebook’s vanity address

The most famous vanity .onion address - https://www.facebookcorewwwi.onion/ - belongs to none other than Facebook. Using the same method as outlined below, the engineers at Facebook generated a bunch of keys and searched for the prefix pattern “facebook.”

facebook-vanity-tor-address

Onion hash generator software

There’s multiple programs available which will mass-generate hashes for you. They’re all forked from onionhash-0.0.1, which was originally released in 2006. The two most popular forks are Scallion and Eschalot. For this guide, I’ll be using Eschalot.

Install Eschalot

apt install build-essential libssl-dev
git clone https://github.com/ReclaimYourPrivacy/eschalot.git
cd eschalot
make

Generate hashes

The parameters are: -p for the search prefix -t for number of threads -v for verbose output

./eschalot -vp ericm -t 4 > ericm.txt
Verbose, single result, no digits, 4 threads, prefixes 5-5 characters long.
Thread #1 started.
Thread #2 started.
Thread #3 started.
Thread #4 started.
Running, collecting performance data...
Found a key for ericm (5) - ericmb4b5vweqimi.onion

In less than a minute the program found a hash matching the “ericm” search prefix and generated a public/private keypair for it.

cat ericm.txt
ericmb4b5vweqimi.onion
-----BEGIN RSA PRIVATE KEY-----
MIICXwIBAAKBgQDN+7yFXdhLfldfdnX7zNqXp6wWw+PE9hgkZDB147X5h0aDSqO0
mI4FVGg5XBQZYc6W0gEWKJUW07txElnWTO3vvgvuRPrA7qPmswrNhX+PKwixOrbL
Jx5YW7hl9E68IXrDBR3AbMWpCfvp7xdfJvjJ+LHoRN3k+Hghozsjs4vzcQIEAqe1
xQKBgCdqip91VlpY95//S50pFZwQmtLkux7pD79MCKSl2rTHvyTc9dBb7JJYle4U
4mZDN24TdNpDdNJZbRKP9Bp8gAEWKw2uFLve/7RMsKBmEcEzbiYZozwKqwFzXCy8
h+qEkmZjkdyEeNZQnitWVcGgEsO9GwHqDvgeSjTLu5U+kiEfAkEA76QoJ/uzcluc
5M1xuUvu99iHws6z2YigHKwrlGFEQOKX5FIQ0MqRCu7z8L9C4yP6PnQyxT2q64WN
O3a8D9/mhwJBANwLZF8+MSFVGsKAxzR201bISZi89gWkO7xXGKZENNcNSUjyQxnQ
BTJKCYsHLCvepVFHsgG7siIgWo2j1Emx3EcCQQCMTaWMQsqa0W7SJ8wXbYth72yI
1on4alPCcKAl+9PN7noUvDkcapOmaRINGttPHi8VGg7M5fhFiHUD0kYb7WQfAkEA
zKIUq7zO02nqIY3RYz4sPWxh6ABvv7pMw+7WVoGchi1t900FFM86cKYfSNCWnYN+
Y+sXNwiDK7dibcqGY8CxwQJBANeR7wmmHXZo041gDQpTqHx59Z3e4oDiVbiARLND
oZYqcYg1uPW819Nhlhu8x/GVNFXnmD8+zOYPxTMGJIiZvhs=
-----END RSA PRIVATE KEY-----

Install the key

Inside of the torrc file, you can specify [HiddenServiceDir] the directory where your hidden service information will be stored at. A common location will be /var/lib/tor/hidden_service/.

There will be a file in your hidden_service directory called private_key. Go ahead and copy the lines between —–BEGIN RSA PRIVATE KEY—– and —–END RSA PRIVATE KEY—– from Echalon’s output into this file.

Restart Tor and you’ll be able to access your new hidden service.


Tags: #tor

© Eric Mathison 2017-2020.