.onion v3 vanity address generator
Find a file
2025-11-03 15:33:51 +03:00
.cargo improved performance 2025-10-24 22:27:59 +03:00
src moved Worker, Uplink, etc to crate::glue 2025-11-02 17:03:05 +03:00
.gitignore POC 2024-12-14 21:11:41 +03:00
Cargo.lock added regex search strategy 2025-10-29 22:52:44 +03:00
Cargo.toml added regex search strategy 2025-10-29 22:52:44 +03:00
README.md readme typos 2025-11-03 15:33:51 +03:00

About

A tool designed to generate hidden service version 3 secret keys with their .onion addresses matching a given regex.

This implementation is focused on hackability rather than performance. If you need raw performance consider mkp224o.

Usage

Command-line interface

--help

Search for .onion v3 address keys with a regular expression

Usage: pretty-onion-v3 [OPTIONS] <REGEX>

Arguments:
  <REGEX>  Regular expression to search for

Options:
  -k, --key-num <KEY_NUM>        Number of keys to search for [default: 1]
  -s, --save-dir <SAVE_DIR>      Directory to save the found keys [default: results]
  -b, --batch-size <BATCH_SIZE>  Key batch size per worker thread [default: 1024]
  -t, --thread-num <THREAD_NUM>  Explicitly set the number of worker threads
  -h, --help                     Print help
  -V, --version                  Print version

Regex syntax

Regular expressions syntax can be found in the regex crate documentation. An onion address matches the expression if is_match method returns true.

How to use the found keys

Background

A hidden service directory, specified by HiddenServiceDir in torrc, should contain three related files:

  • hostname: .onion address in ASCII
  • hs_ed25519_public_key: public key in "standard" form and custom binary format
  • hs_ed25519_secret_key: secret key in "expanded" form and custom binary format

In practice, however, if the hostname and hs_ed25519_public_key files are absent C Tor will automatically derive them from the hs_ed25519_secret_key file on startup.

Save format

The found keys are saved in the directory specified by --results-dir, results by default, with the following structure:

results
├── test5zwvw2qixbz5vhdocuo6qzeh5h3ldka4wqfv2stjqn2qqrm3zpyd.onion
│   ├── hs_ed25519_secret_key
│   └── raw_secret_key
├── testqatmwovugczdgm7sfcurucbthfmpmpk2ulqdyhfls4tig2lkacyd.onion
│   ├── hs_ed25519_secret_key
│   └── raw_secret_key
└── testuycwbzvq2e4vlsjtkktzagxx4iahg6dlmwqarsoatsdtukaq56yd.onion
    ├── hs_ed25519_secret_key
    └── raw_secret_key

A hs_ed25519_secret_key file is suitable to be placed in a hidden service directory.

C Tor stores keys in a non-standard "expanded" form which is different from the standard 256-bit representation. The expansion process is irreversible since it starts with the hashing of a key in the standard form. For this reason the key in standard form is saved as a raw_secret_key file.

Building

Run cargo build --locked --release.

There are some optimizations enabled for target.x86_64-unknown-linux-gnu in .cargo/config.toml which are absent for other targets.