This project is a human-driven random number generator built in JavaScript. It collects keystrokes and measures the timing between them to produce entropy β randomness influenced by unpredictable human behavior.
- Captures real-time keyboard input from the user
- Measures time intervals between keystrokes
- Generates randomness based on typing dynamics
- Fully client-side, no external dependencies
- The user begins typing in the input field.
- The app listens for
keydownevents. - On each keydown:
- The key is added to the
pressedKeysarray - The time delta since the last keydown event is added to the
keyTimingsarray
- The key is added to the
- The arrays
pressedKeysandkeyTimingsare combined using XOR - The result is salted with the user input and hashed using the FNV-1a algorithm
- The hash is reduced to a number between 0β99 using a modulo operation
Human typing behavior is unpredictable and difficult to replicate. The variable timing between keydowns introduces non-deterministic data, which makes the outcome hard to fake or reproduce β a key trait of entropy.
- Seeding PRNGs or other algorithms requiring non-determinism
- Adding personalized randomness to games
- Educational demos on entropy and hashing
- HTML5
- CSS3
- Vanilla JavaScript
No external libraries are required.
- Clone or download the repository
- Open
index.htmlin a modern browser - Start typing random characters in the input field
- Watch the entropy data update in real-time
- Generate a random number
This tool generates decent entropy for educational or casual use, but it should not be used for cryptographic security, password generation, private key creation, or secure token generation.
MIT License β free to use, modify, and distribute. Attribution is appreciated.
Made with β€οΈ, XORs, and unpredictable typing.