Created
April 23, 2019 15:39
-
-
Save marklister/940ee0106006fd9c2b65ea413a3e9c93 to your computer and use it in GitHub Desktop.
Wireguard vanity genkey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# "Vanity" keygen for Wireguard | |
# Example usage: ./vanity-genkey '^CPT/|^HRE/|^EDI/' | |
# Or on a multi core machine ./vanity-genkey '^CPT/|^HRE/|^EDI/' >> keys & | |
# Spawn as many as your computer can deal with. | |
# Adding -i to the grep will speed things up at the expense of readability | |
PUB="" | |
while [ -z "$PUB" ]; | |
do | |
PVT=$(wg genkey) | |
PUB=$(echo $PVT | wg pubkey | grep -E $1) | |
done | |
echo $PVT | |
echo $PVT | wg pubkey | grep --color -E $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment