Dice to Private Key Generator
This educational tool converts a sequence of physical dice rolls (digits 1–6) into a valid elliptic-curve private key. Two complementary approaches are offered:
-
Approach A: Direct Entropy by Base-6 Conversion
Each dice roll becomes a digit in base-6. The resulting large number is converted to a BigInt and used directly as the private key (provided it is smaller than the selected curve order). This method preserves entropy exactly and demonstrates a pure mathematical mapping from randomness to a private key. -
Approach B: Entropy to Randomness by PBKDF2-HMAC-SHA512
The dice sequence is fed into the standard Key Derivation Function PBKDF2 (200 000 iterations, SHA-512). A user-supplied salt is required. The 256-bit output is interpreted as the private key. This approach reduces any small bias present in the dice and makes exhaustive search of the original dice sequence computationally expensive.
You can choose between the two most common 256-bit curves: secp256k1 and secp256r1 (NIST P-256). Both approaches produce a cryptographically valid private key for the selected curve when the numeric value lies in the proper range.
Everything runs entirely inside your browser — no data is ever uploaded to a server.
Disclaimer
This is an educational demonstration only. The generated private keys should never be used for real funds, production systems, or any security-critical purpose.
Always use well-reviewed, hardware-backed, or officially audited entropy sources and key-generation tools when creating real private keys. The author and contributors accept no liability for any loss or damage resulting from the use of this page. Use for high-stakes cryptography is entirely at the user’s own risk.
| Input Dice Rolls | |
|---|---|
|
|
|
|
Select elliptic curve:
|
|
|
Choose derivation approach:
|
|
| Log |
|---|
| Final Private Key (hex) |
|---|
Acknowledgments
Special thanks to Grok and Copilot for helping build this educational tool.