.onion address generator

cathugger 5172c0fd71 make depends há 9 meses atrás
.github 42e4d3a5fc Docker support (#99) há 1 ano atrás
contrib fb5320a537 gpg TZ há 10 meses atrás
ed25519 68928c4984 fix assembler compilation on MacOS há 1 ano atrás
.editorconfig 30491bd9f8 various things há 4 anos atrás
.gitattributes 4e91c7dbf2 .gitattributes: make sure *.h *.c are detected as C há 6 anos atrás
.gitignore eea863e3ac a bit of calcest and some other stuff há 3 anos atrás
COPYING.txt 4a7097fc4c README & COPYING há 7 anos atrás
GNUmakefile.in 5172c0fd71 make depends há 9 meses atrás
OPTIMISATION.txt 158964b251 adjust OPTIMISATION.txt for current stuff há 4 anos atrás
README.md b0f394c17a README.md: attempt to fix há 11 meses atrás
autogen.sh 81cebae449 add amd64-{51-30k,64-24k} from SUPERCOP, now use autoconf há 7 anos atrás
base16.h 7887d086f2 improvements all over the place há 7 anos atrás
base16_from.c 30d26a3e67 some more explicitness há 6 anos atrás
base16_to.c 9b80e8676c init há 7 anos atrás
base32.h 91f484cbc7 harden pseudo-YAML validation há 6 anos atrás
base32_from.c 30d26a3e67 some more explicitness há 6 anos atrás
base32_to.c 7887d086f2 improvements all over the place há 7 anos atrás
base64.h 5c58f03805 split worker off há 5 anos atrás
base64_from.c ee0257dc88 stronger base64 validation há 6 anos atrás
base64_to.c 6a416795b7 optional functionality for writing results to the single file and extracting specific keys from it há 6 anos atrás
calcest.c b428196b5e more stuff há 2 anos atrás
common.h c57f10316f rawyaml mode há 4 anos atrás
configure.ac 5ac2c8fa60 some cleanups & make depend há 2 anos atrás
cpucount.c 33162701fe glibc isn't limited to linux há 5 anos atrás
cpucount.h e6a879949b explicit void declaration, remove unused arg. thanks ccomp há 7 anos atrás
filters.h 92b36121b6 explicit void params declarations, add warnings to keep it correct há 5 anos atrás
filters_common.inc.h f43c3b021e fix intfilter expansion logic há 3 anos atrás
filters_inc.inc.h 30491bd9f8 various things há 4 anos atrás
filters_main.inc.h c9d018a253 whatever i implemented it anyway há 3 anos atrás
filters_worker.inc.h 5c58f03805 split worker off há 5 anos atrás
hex.h 92d0e26b5d add numwords functionality há 7 anos atrás
ifilter_bitsum.h fc6285523f fix compilation err in non-intfilter cases há 3 anos atrás
ioutil.c f667a8a256 fix syncwritefile on windows há 2 anos atrás
ioutil.h 5b4074a47e make checkpoint stuff actually proper há 3 anos atrás
keccak.c e6a879949b explicit void declaration, remove unused arg. thanks ccomp há 7 anos atrás
keccak.h e6a879949b explicit void declaration, remove unused arg. thanks ccomp há 7 anos atrás
likely.h 9e9468b453 some fixes and optimizations há 7 anos atrás
main.c 870c089a3c better ruler fix há 1 ano atrás
test_base16.c ebe1d5b678 delet trailing whitespace há 6 anos atrás
test_base32.c ebe1d5b678 delet trailing whitespace há 6 anos atrás
test_base64.c 390e8ea9de cleanups, make clang happy há 5 anos atrás
test_ed25519.c f374555fd4 rebase on newer SUPERCOP, use PIE, some other stuff há 2 anos atrás
testutil.h 9032811fc5 small cleanup, makefile preparation for calcdiff há 4 anos atrás
types.h 5bc2b09504 more flexible intfilter config há 7 anos atrás
vec.c f862c7897e some vec tweaks há 7 anos atrás
vec.h abc08bc47b small fixup, implement deduplication support há 6 anos atrás
worker.c 4cc50f41ce onionready: always refer warnnear há 1 ano atrás
worker.h 80e1bd0b47 near passkeys skip/warn modes & help tweak há 1 ano atrás
worker_batch.inc.h 80e1bd0b47 near passkeys skip/warn modes & help tweak há 1 ano atrás
worker_batch_pass.inc.h 80e1bd0b47 near passkeys skip/warn modes & help tweak há 1 ano atrás
worker_impl.inc.h 2b417046b6 remove slow/fast workers há 1 ano atrás
yaml.c 309b86fd59 more helpful error messages há 1 ano atrás
yaml.h c57f10316f rawyaml mode há 4 anos atrás

README.md

mkp224o - vanity address generator for ed25519 onion services

This tool generates vanity ed25519 (hidden service version 3^1^2, formely known as proposal 224) onion addresses.

Requirements for building

  • C99 compatible compiler (gcc and clang should work)
  • libsodium (including headers)
  • GNU make
  • GNU autoconf (to generate configure script, needed only if not using release tarball)
  • UNIX-like platform (currently tested in Linux and OpenBSD, but should also build under cygwin and msys2).

For debian-like linux distros, this should be enough to prepare for building:

apt install gcc libc6-dev libsodium-dev make autoconf

Building

Run ./autogen.sh to generate a configure script, if there isn't one already.

Run ./configure to generate a makefile. On *BSD platforms you may need to specify extra include/library paths: ./configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib".

On AMD64 platforms, you probably also want to pass something like --enable-amd64-51-30k to the configure script invocation for faster key generation; run ./configure --help to see all available options.

Finally, make to start building (gmake in *BSD platforms).

Usage

mkp224o needs one or more filters to work. You may specify them as command line arguments, eg ./mkp224o test, or load them from file with -f switch.

It makes directories with secret/public keys and hostnames for each discovered service. By default, the working directory is the current directory, but that can be overridden with -d switch.

Use -s switch to enable printing of statistics, which may be useful when benchmarking different ed25519 implementations on your machine.

Use -h switch to obtain all available options.

I highly recommend reading OPTIMISATION.txt for performance-related tips.

FAQ and other useful info

  • How do I generate address?

Once compiled, run it like ./mkp224o neko, and it will try creating keys for onions starting with "neko" in this example; use ./mkp224o -d nekokeys neko to not litter current directory and put all discovered keys in directory named "nekokeys".

  • How do I make tor use generated keys?

Copy key folder (though technically only hs_ed25519_secret_key is required) to where you want your service keys to reside:

  sudo cp -r neko54as6d54....onion /var/lib/tor/nekosvc

You may need to adjust ownership and permissions:

  sudo chown -R tor: /var/lib/tor/nekosvc
  sudo chmod -R u+rwX,og-rwx /var/lib/tor/nekosvc

Then edit torrc and add new service with that folder.\ After reload/restart tor should pick it up.

  • How to generate addresses with 0-1 and 8-9 digits?

Onion addresses use base32 encoding which does not include 0,1,8,9 numbers.\ So no, that's not possible to generate these, and mkp224o tries to detect invalid filters containing them early on.

  • How long is it going to take?

Because of probablistic nature of brute force key generation, and varience of hardware it's going to run on, it's hard to make promisses about how long it's going to take, especially when the most of users want just a few keys.\ See this issue for very valuable discussion about this.\ If your machine is powerful enough, 6 character prefix shouldn't take more than few tens of minutes, if using batch mode (read OPTIMISATION.txt) 7 characters can take hours to days.\ No promisses though, it depends on pure luck.

  • Will this work with onionbalance?

It appears that onionbalance supports loading usual hs_ed25519_secret_key key so it should work.

  • Is there a docker image?

Yes, if you do not wish to compile mkp224o yourself, you can use the ghcr.io/cathugger/mkp224o image like so:

  docker run --rm -it -v $PWD:/keys ghcr.io/cathugger/mkp224o:master -d /keys neko

Acknowledgements & Legal

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see CC0.

  • keccak.c is based on Keccak-more-compact.c
  • ed25519/{ref10,amd64-51-30k,amd64-64-24k} are adopted from SUPERCOP
  • ed25519/ed25519-donna adopted from ed25519-donna
  • Idea used in worker_fast() is stolen from horse25519
  • base64 routines and initial YAML processing work contributed by Alexander Khristoforov (heios at protonmail dot com)
  • Passphrase-based generation code and idea used in worker_batch() contributed by foobar2019