💾 Archived View for sir-photch.xyz › wicuvanity.gmi captured on 2024-09-29 at 00:03:12. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
... that fills YOUR niche usecase that is: generating wireguard vanity keys. But really fast! On your GPU!
Initial writeup: 2024-09-28
So because of the stuff that I was and still am doing at work right now I came in contact with CUDA programming and how computing stuff can be sped up using that.
And while I was just learning about that programming model, I had to generate some vanity keys for new hosts that I added to my wireguard network.
Wireguard keys being ed25519 curve public / private keys, you quickly come in contact with strings that look like:
3IoFKcJHn5SEnx3wRZNbhuFSL3E0EUcGEQa3Tg3gsXU
which by themselves don't convey any meaning. Wouldn't it be great if we had something like:
marktni+SbIHW/9KhsUewRoVX/w99TNOMraFMRmfn04=
for a user called "mark"? Then, we'd have a "vanity key".
Now, this key is the public key for distribution to other hosts. It depends on a private key though (curve25519), and for a private key's public key to start with some fancy prefix, we need to generate and check _lots_ of keypairs.
And this is where wicuvanity comes in. In case you have a Nvidia GPU slumbering in your Computer, you might as well utilize it for generating vanity keypairs! After all, recent GPUs come with _many_ more threads than CPUs. Yes, they are dumber threads than CPU threads, but by having so much more of them, we can achieve a much higher throughput.
In fact, comparing the `wireguard-vanity-address`-tool that is in the extra repo of Arch against wicuvanity, on an i9-14900K against wicuvanity on a RTX 4090, I was able to achieve roundabout four times the throughput. Even better: your GPU's computations are (mostly) independent from you CPU's, so you can run both at the same time!
It has never been easier to generate keys starting with prefixes like:
dontbuynvidiaiKb7p96ObtDtPhMIHLW4kJ4OmRGF2Q=
because nvidia's monopoly on HPC is staggering. But for good reason! Their GPUs are just _that_ fast... 🥲
ROCM version, when?
You can find the sourcecode on sourcehut:
https://git.sr.ht/~chrs/wicuvanity
And a PKGBUILD on the AUR:
https://aur.archlinux.org/packages/wicuvanity
Next steps? gmlgcd 2.0! I made lots of changes for it to be useful software. Cheers!