#gpg #vanity #key #openpgp #generate #filtering #back-end

bin+lib vanity_gpg

A simple tool for generating and filtering vanity GPG keys, c0nCurr3nt1Y

4 releases (2 breaking)

0.3.2 Jun 7, 2022
0.3.0 Mar 24, 2021
0.2.0 Sep 26, 2020
0.1.0 Jun 8, 2020

#2518 in Command line utilities

MIT and maybe LGPL-2.0-or-later

67KB
1.5K SLoC

VanityGPG (vanity_gpg)

license

A simple tool for generating and filtering vanity GPG keys (a.k.a. A OpenPGP key fingerprint collision tool), c0nCurr3nt1Y.

Install

Currently(v0.3), VanityGPG offers two sets of backends, Sequoia-OpenPGP and rPGP. If you have libclang available in your system, the default sequoia backend is recommend.

Install dependencies (assuming you are using Ubuntu, bruh) for the sequoia backend:

apt install git rustc cargo clang make pkg-config nettle-dev libssl-dev capnproto libsqlite3-dev

Install VanityGPG with cargo:

cargo install vanity_gpg

If your system does not offer libclang, there is also a pure rust rPGP backend available:

cargo install vanity_gpg --no-default-features --features rpgp

If the rPGP backend is used, it's not recommended to use the key generated by it as your main key. It uses a PRNG for generating random numbers, which is considered (kind of) insecure.

Performance

With the following parameters:

./vanity_gpg -c Ed25519 -jX -u "Kay Lin <i@v2bv.net>" -p "(8B){5,20}$|(B8){5,20}$|(EB){5,20}$|(BE){5,20}$|(EF){5,20}$|(FE){5,20}$|A{10,40}$|B{10,40}$|C{10,40}$|D{10,40}$|E{10,40}$|F{10,40}$|1{10,40}$|2{10,40}$|3{10,40}$|4{10,40}$|5{10,40}$|6{10,40}$|7{10,40}$|8{10,40}$|9{10,40}$|0{10,40}$|1145141919810$"
System/Backend Sequoia Notes
Tegra210 (X1) @ 1.9GHz (-j4) ~6,300,000 hash/s Fedora AArch64, sequoia backend, Jetson Nano
Intel Xeon E3-1231 V3 @ 3.4GHz (-j8) ~15,000,000 hash/s FreeBSD, sequoia backend, without jemalloc
Intel Core i7-8569U @ 2.8GHz (-j8) ~18,000,000 hash/s macOS, sequoia backend, built with Nix
AMD Ryzen 5 3600 @ 3.9GHz (-j12) ~80,000,000 hash/s NixOS, sequoia backend
AMD Ryzen 7 3700x @ 4.1GHz (-j16) ~120,000,000 hash/s AOSC OS, sequoia backend

Credits

Sequoia-OpenPGP and the rPGP teams for their awesome works.

@nwalfield for the extremely helpful tips that improves VanityGPG's performance for several orders of magnitude (#2).

Usage

vanity_gpg 0.3.0
A simple tool for generating and filtering vanity GPG keys, c0nCurr3nt1Y

USAGE:
    vanity_gpg [FLAGS] [OPTIONS] --pattern <pattern>

FLAGS:
    -d, --dry-run    Dry run (does not save matched keys)
    -h, --help       Prints help information
    -v, --verbose    Verbose level
    -V, --version    Prints version information

OPTIONS:
    -c, --cipher-suite <cipher-suite>
            Cipher suite [default: Ed25519] [possible values: Ed25519, RSA2048, RSA3072, RSA4096,
            NISTP256, NISTP384, NISTP521]

    -j, --jobs <jobs>                    Number of threads [default: 8]
    -p, --pattern <pattern>              Regex pattern for matching fingerprints
    -u, --user-id <user-id>              OpenPGP compatible user ID

Notes:

  • There will be an extra thread spawned for displaying summary.
  • It's recommended to use multiple rules with regex for maximum efficiency.

Errata

On AArch64 machines, you may have to disable the "asm" feature for sha-1 before compiling.

Dependencies

~12–28MB
~397K SLoC