| .cargo | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
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:.onionaddress in ASCIIhs_ed25519_public_key: public key in "standard" form and custom binary formaths_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.