Skip to content

Use chacha20 for basis of RNG #31

@coderdan

Description

@coderdan

Vitamin C uses rand (and thus rand_chacha) for the underlying random implementations.
Some of the main challenges with this approach:

  • rand is a general purpose library for generating random data and as such cryptographically secure random number generation isn't necessarily its top priority
  • rand_chacha doesn't support Zeroization so there is a risk that state could remain accessible in memory allowing for potential attacks

There is a long and still ongoing discussion about replacing the current CSPRNG implementation in rand with the chacha20 crate from Rust Crypto.
Thus far it remains unresolved.

We could wait until there is a resolution to the above or consider directly using chacha20 in SafeRand and avoid the rand crate entirely.
Our needs a quite specific so this may be a reasonable approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions