wireguard-vanity-key

command module
v0.0.0-...-bab38bc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2025 License: BSD-3-Clause Imports: 19 Imported by: 0

README

wireguard-vanity-key

Inspired by wireguard-vanity-address "faster algorithm", this tool searches for a WireGuard Curve25519 keypair with a base64-encoded public key that has a specified prefix.

Example

Install the tool locally and run:

$ go install github.com/AlexanderYastrebov/wireguard-vanity-key@latest
$ wireguard-vanity-key -prefix=2025
private                                      public                                       attempts   duration   attempts/s
WHakaGFouuy2AxMmOdSTf2L2KWsI6a3s+gvAOKuKtH0= 2025sb38RUVI+GJg5Uk2RRPuJfhZyg4uSxfV2WDn1g8= 47423039   2s         19926032

$ # verify
$ echo WHakaGFouuy2AxMmOdSTf2L2KWsI6a3s+gvAOKuKtH0= | wg pubkey
2025sb38RUVI+GJg5Uk2RRPuJfhZyg4uSxfV2WDn1g8=

or run the tool from the source repository:

$ go run . -prefix=2025

or use Docker image:

$ docker pull ghcr.io/alexanderyastrebov/wireguard-vanity-key:latest
$ docker run  ghcr.io/alexanderyastrebov/wireguard-vanity-key:latest -prefix=2025

Performance

The tool checks ~26'000'000 keys per second on a test machine:

$ go run . -prefix=GoodLuckWithThisPrefix -timeout=20s
private                                      public                                       attempts   duration   attempts/s
-                                            GoodLuckWithThisPrefix...                    520729600  20s        26016401

In practice it finds 4-character prefix in a second and 5-character prefix in a minute:

$ while go run . -prefix=AYAYA ; do : ; done
private                                      public                                       attempts   duration   attempts/s
OM9WvIxO90NRnHpMLBYbKCwRxj1KcwWVfo5EO1vftls= AYAYAgcnXbdsMwLB+nR0kkWDpIkMr+3thhfGnBEvTmM= 515859548  23s        22328225
private                                      public                                       attempts   duration   attempts/s
eEbiqUhcUrH6Uj1p7cycgTOspY6fMxxImSNNr1YvaEg= AYAYA4yow92Ks1wnbQeceKEWIYHhaRyezomUz9SQJic= 350598404  19s        18060407
private                                      public                                       attempts   duration   attempts/s
OOkjEu4elrWJ4MD+OxB2kvUcKdyo482E3G3Y/tLBsmI= AYAYAW4yGEUVT/IkX3T6ZZTnz3yPS1lPxiRe0yhOCCs= 260273230  14s        17972036
private                                      public                                       attempts   duration   attempts/s
+BWkcGvbkXFxNgxIrAYyJoMF1R6R3eguv5NyMsdlaEA= AYAYAQEsY0gagwZ5lGLRQYfxQ+5rl83LOPmaASvASFQ= 1094012149 56s        19446702
private                                      public                                       attempts   duration   attempts/s
aG7Rakjbn1kpc2HN7fUz1u/ZrTcYziXg7OJq2EcMWFU= AYAYAe9QZdXn36CrkOK8aoD8h92mbEHCQt1QdTBARjY= 1088287697 56s        19483959

Each additional character increases search time by a factor of 64.

The tool supports blind search, i.e. when worker does not know the private key, see demo-blind.sh.

Similar projects

Documentation

Overview

Package main searches for vanity X25519 key based on algorithm described here https://github.com/warner/wireguard-vanity-address/pull/15

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL