This tool is designed to generate BIP-39 mnemonic phrases (24-word seed phrases) based on Unix timestamps, specifically exploring phrases that could be generated through the "Milk Sad" vulnerability (CVE_2023-39910).
The Milk Sad Mnemonic Generator creates 24-word BIP-39 mnemonic phrases by leveraging Unix timestamps as an entropy source. It aims to generate all possible seed phrases that might have been produced due to the specific timestamp-based entropy collection flaw associated with the "Milk Sad" vulnerability.
- Generates 24-word BIP-39 mnemonics.
- Supports multiple language wordlists (English, Spanish, Japanese, French, Italian, Portuguese, Korean, Russian, Ukrainian, Czech, Chinese Simplified, Chinese Traditional).
- Can generate for specific dates, date ranges, or the entire 32-bit timestamp range.
- Automatically saves progress and can resume interrupted generations.
You have two options how to install and run on your system:
This script automates the compilation process and handles common dependencies for Debian/Ubuntu-based Linux systems.
- Open your terminal and navigate to the project's root directory:
cd MilkSad-Mnemonic-Generator
- Make the script executable:
chmod +x install.sh
- Run the installation script:
The script will check for necessary build tools (like
./install.sh
g++
,make
,qmake
,libssl-dev
,libqt5widgets5-dev
). If any are missing, it will attempt to install them (prompting for yoursudo
password if needed). After successfully setting up dependencies, it will compile both the CLI and GUI applications and place them directly in the project's root directory.
If you prefer to compile the applications yourself, follow these manual steps:
Ensure you have the following development packages installed on your Debian/Ubuntu system:
g++
(typically part of thebuild-essential
package)make
(also part ofbuild-essential
)qmake
(provided byqt5-qmake
orqtbase5-dev
)libssl-dev
(essential for cryptographic functions used by the tool)libqt5widgets5-dev
(required for Qt GUI development; this package often includesqtbase5-dev
)
You can install these prerequisites using:
sudo apt update
sudo apt install build-essential qt5-qmake libssl-dev qtbase5-dev
- Navigate to the CLI source directory:
cd src/cli
- Compile the application using
g++
:g++ -std=gnu++11 -Wall -Wextra -O2 milk_sad_generator.cpp -o milk_sad_generator -lcrypto -lssl
- Move the compiled CLI executable to the project root:
mv milk_sad_generator ../../
- Return to the project root:
cd ../..
- Navigate to the GUI source directory:
cd src/gui
- Run
qmake
to generate the Makefile for the Qt project:qmake mnemonic_generator.pro
- Compile the GUI application using
make
:make
- Move the compiled GUI executable to the project root:
mv milk_sad_generator_gui ../../
- Return to the project root:
cd ../..
- Move the
Pic/
folder: For the GUI to correctly find its background image you must move thePic/
folder fromsrc/gui/
to the project root:mv src/gui/Pic .
Once installed, you'll find two executables directly in your project's root directory: ./milk_sad_generator
(the Command Line Interface version) and ./milk_sad_generator_gui
(the Graphical User Interface version).
- Start the program:
./milk_sad_generator_gui # To launch the GUI application # OR ./milk_sad_generator # To launch the CLI application
- Select the mnemonic phrase language from the options presented (e.g., English, Spanish, Japanese).
- Choose one of the three available generation modes:
This mode generates a single 24-word mnemonic phrase for a precise date and time you specify.
- Example Usage:
- Enter date/time:
1970-01-01 00:00:00
for first timestamp. If chosen english it will generate "milk sad ..." mnemonic. - Output: A single mnemonic phrase will be generated and saved to
mnemonic_[language].txt
.
- Enter date/time:
This mode generates mnemonics for every timestamp within a specified start and end date range.
- Example Usage:
- Enter date range:
2017-01-01:2018-12-31
(This will generate mnemonics for all timestamps between January 1, 2017, and December 31, 2018, inclusive.) - Output: All generated mnemonics for the specified range will be saved to
mnemonics_range_[language].txt
. - Progress is automatically saved every 100,000 timestamps. This feature allows you to safely stop the generation (e.g., by pressing
Ctrl+C
) and resume later without losing progress.
- Enter date range:
This mode generates all possible mnemonics across the entire 32-bit Unix timestamp range (from January 1, 1970, to January 19, 2038).
- WARNING: The output file generated by this option can be extremely large (potentially 300-600GB). Ensure you have a significant amount of free disk space before starting this mode and test with smaller ranges first.
- Output: All mnemonics will be saved to
all_mnemonics_[language].txt
. - Progress is saved periodically. Be aware that this generation process can take days complete, depending on your system's performance.
- Single mnemonic generation:
mnemonic_[language].txt
- Date range generation:
mnemonics_range_[language].txt
- Full range generation:
all_mnemonics_[language].txt
- Progress files (for resuming):
generation_progress_range.bin
(for Option 2) /generation_progress_full.bin
(for Option 3)
- The tool performs all timestamp calculations using UTC (Coordinated Universal Time).
- For large-scale generations, particularly the "Full Range" option, it is crucial to ensure you have sufficient disk space available.
- You can safely stop a generation at any time by pressing
Ctrl+C
. The tool will automatically save its current progress. - Upon successful completion of a generation mode, the corresponding
.bin
progress file will be automatically deleted.
If you had to stop a generation process (e.g., using Ctrl+C
), you can seamlessly resume from where you left off:
-
For Date Range generation (Option 2):
- Simply run the program again and select Option 2.
- Enter the exact same date range you used previously.
- The tool will automatically detect the
generation_progress_range.bin
file and continue generating from the last saved timestamp.
-
For Full Range generation (Option 3):
- Run the program again and select Option 3.
- The tool will automatically locate the
generation_progress_full.bin
file and resume the generation from the point it was interrupted.
- Do NOT delete the
.bin
progress files (generation_progress_range.bin
orgeneration_progress_full.bin
) if you intend to resume a generation. - The progress files are automatically deleted only when the generation process completes successfully.
- If you wish to start a generation over from the very beginning (disregarding previous progress), you must manually delete the corresponding
.bin
progress file and rename/delete/move any existing output file (mnemonics_range_[language].txt
orall_mnemonics_[language].txt
) from previous runs before starting the program again. - Be aware that if you start a "Date Range" generation (Option 2) with a different date range, or a "Full Range" generation (Option 3) with the same language where an
all_mnemonics_[language].txt
already exists, the.bin
progress file will be overwritten, and new mnemonics will be appended to the existing output file.
Here's an example of a 24-word BIP-39 mnemonic phrase generated by this tool:
vault alarm sad mass witness property virus style good flower rice alpha viable evidence run glare pretty scout evil judge offer refuse another breeze
For verification purposes or quick reference, the tests/
directory in this repository contains examples of generated mnemonic phrases for various languages for 1970-01-01 00:00:00 UTC timestamp.
To convert the generated mnemonic phrases into Bitcoin addresses (supporting P2PKH, P2SH-P2WPKH, and P2WPKH formats), you can use this tool:
- z1ph1us/btc-address-generator: https://github.com/z1ph1us/btc-address-generator
If you found this project useful and would like to encourage me to create more tools like it, consider donating:
- Bitcoin (BTC):
bc1qg7xmlsdxfgu3muxherh4eee2ywj3gz8qfgct3s
- Ethereum (ETH):
0x1B449E1D545bD0dc50f361d96706F6C904553929
- Solana (SOL):
F776tt1it7vifCzD9icrsby3ujkZdJ8EY9917GUM3skr
- Tron (TRX):
TJj96B4SukPJSC4M2FyssoxduVyviv9aGr
- Polygon (POL):
0x1B449E1D545bD0dc50f361d96706F6C904553929
- Monero (XMR):
48aaDb1g4Ms7PB3WMj6ttbMWuEwe171d6Yjao59uFJR38tHa75nKwPqYoPAYmWZPUhXmDbDvqtE6d2FX3YaF1dVE7zhD9Dt