The 30-second summary
crypto.getRandomValues() is the Web Crypto API's cryptographically strong in-process RNG. It's backed by the OS CSPRNG, free, sub-microsecond, and the correct primitive for tokens, salts, IVs, and anything you don't want anyone outside your process to observe.
Provable.io answers a different question: how do you let a third party verify the result you just produced? You can't, with getRandomValues() — the call is invisible from outside the process. Provable.io publishes a hash, then reveals it, so anyone can re-derive the bytes.
Feature matrix
| Capability | Provable.io | crypto.getRandomValues() |
|---|---|---|
| Cryptographic strength | HMAC-SHA256 keyed stream | OS CSPRNG (/dev/urandom, BCryptGenRandom) |
| Reproducible from seed | Yes | No — fresh entropy every call |
| Third-party verifiability | Yes | No |
| Pre-commitment | Yes — serverHash published first | No |
| Latency | ~tens of ms (network) | Sub-microsecond (in-process) |
| Auditable history | Yes — persisted, addressable by short ID | No |
| External dependency | Yes — HTTP | No — Web Crypto in every modern runtime |
| Best for | Public-audience draws that need proof | Tokens, salts, IVs, key material, internal IDs |
When crypto.getRandomValues() is the right answer
Anywhere the bytes never leave your process or only need to be unobservable — not verifiable:
- Session tokens, CSRF tokens, password reset tokens. No external verifier, latency matters, secrecy is the whole point.
- Cryptographic key material. AES keys, HMAC keys, nonces, IVs — always from the OS CSPRNG.
- Request IDs, DB keys, internal jitter. Nobody is auditing these.
When Provable.io is the right answer
A CSPRNG can't help when the audience is outside your process. Use Provable.io when:
- A user might dispute the outcome. See raffle picker and A/B bucketing.
- An auditor or regulator needs to re-derive the result months later.
- You're publishing the draw publicly. NFT mints, public giveaways, gacha pulls.
Try it now
Same shape as crypto.getRandomValues(new Uint8Array(16)), over HTTP — plus a serverHash.
curl "https://api.provable.io/api/bytes?clientSeed=vs-getrandomvalues-demo&count=16&encoding=hex"
FAQ
Is Provable.io as strong as the OS CSPRNG?
For practical purposes the outputs are indistinguishable from uniform randomness. The structural difference is that Provable.io is verifiable, which is what makes it the right shape for public draws and the wrong shape for secret keys.
Can I use Provable.io for key material?
No. Use your OS CSPRNG for anything that has to stay secret. The seed-based design is what makes verification possible — and what makes it unsuitable for keys.
What about Node's crypto.randomBytes()?
Same trust model as crypto.getRandomValues() — both are wrappers over the OS CSPRNG. Same rule of thumb applies.