8000 Use CSPRNG if available. · Issue #18 · paralleldrive/cuid2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Use CSPRNG if available. #18
Open
Open
@ericelliott

Description

@ericelliott

Note: Cuid2 already provides some cryptographically strong guarantees even using Math.random because:

  1. We don't trust the entropy from Math.random so we don't rely on it for cryptographic security. Instead, we mix it with several other independent sources of entropy. Those sources have been proven for more than a decade in apps with hundreds of millions of users via Cuid V1, and helped inspire UUID v6 - v8.
  2. We use a security audited implementation of the cryptographically secure SHA-3 to hash all that entropy so the output is opaque.

As far as we're aware, Cuid2 is safe to use now, and certainly safer than most other id options available.

Because we believe in security in layers, it's still a good idea to source our random bits with a CSPRNG. That is the purpose of this issue.

Idea:
Apparently all modern browsers + node support the cryptographically-secure crypto.randomUUID(), which may make a better source of pseudorandom data than Math.random().

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0