๐Ÿ”ฌ Input Data
๐Ÿ“ Shannon Entropy: H(X) = -ฮฃ p(x) ร— logโ‚‚(p(x))
Perfect random = 8.0 bits/byte • Crypto-safe โ‰ฅ 7.9 • Math.random() โ‰ˆ 6-7
๐Ÿ“Š Entropy Analysis Results
--
Shannon Entropy
bits per byte (max 8.0)
--
Security Rating
Overall assessment
Security Level --
WeakAcceptableStrongPerfect
Total Bytes
--
Unique Bytes
--
Chi-Square p
--
๐Ÿงช NIST Randomness Tests (Subset)
Analyze data to run tests
๐ŸŒก๏ธ Byte Distribution Heatmap
Low freq
High freq
๐Ÿ“ˆ Byte Frequency Distribution
โš”๏ธ Math.random() vs crypto.getRandomValues()
Property Math.random() crypto.getRandomValues()
Entropy (bits/byte) ~6.5 ~7.99
Cryptographic Safe NO โœ— YES โœ“
Predictable YES (LCG) NO (CSPRNG)
Seed Required Internal (hidden) OS Entropy Pool
NIST Compliant NO YES
Use for Keys NEVER RECOMMENDED
State Recovery Possible Impossible
๐ŸŽ‚ Birthday Paradox โ€” Collision Probability

Given a wallet using N bits of entropy, the probability of collision with the Bitcoin network (estimated 100M wallets):

32 bits
Entropy Level
~2.3% collision
64 bits
Entropy Level
~1 in 5ร—10โน
128 bits
BIP39 Standard
~2.7ร—10ยฒยณ years
256 bits
Maximum Security
Computationally impossible
๐ŸŽ“ Why this matters:
BIP39 uses 128-256 bits of entropy for seed generation. Using Math.random() for seed generation reduces effective entropy to ~32-48 bits โ€” making brute force attacks feasible for nation-state attackers. Always use window.crypto.getRandomValues() for any cryptographic randomness.