Skip to content

Conversation

@preuss-adam
Copy link
Contributor

It's a good practice to use deterministic ECDSA by default. However, it is typically slower than using an RNG, e.g., reading from dev/urandom.

The biscuit-rust implementation uses a deterministic ECDSA by default. Also the JWT best practices RFC warns about the dangers of using bad RNG with ECDSA, in https://datatracker.ietf.org/doc/html/rfc8725#section-3.2-5.2:

Elliptic Curve Digital Signature Algorithm (ECDSA) signatures [ANSI-X962-2005] require a unique random value for every message that is signed. If even just a few bits of the random value are predictable across multiple messages, then the security of the signature scheme may be compromised. In the worst case, the private key may be recoverable by an attacker. To counter these attacks, JWT libraries SHOULD implement ECDSA using the deterministic approach defined in [RFC6979]. This approach is completely compatible with existing ECDSA verifiers and so can be implemented without new algorithm identifiers being required.

Use BeforeEach for a cleaner test setup.
@preuss-adam preuss-adam force-pushed the apreuss/deterministic-ecdsa branch from 596cb70 to ae54ea6 Compare January 21, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant