Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide APIs to generate cryptographically secure random numbers #286

Open
CompeyDev opened this issue Dec 24, 2024 · 1 comment
Open

Provide APIs to generate cryptographically secure random numbers #286

CompeyDev opened this issue Dec 24, 2024 · 1 comment

Comments

@CompeyDev
Copy link
Contributor

Lune currently does not include any methods for generating cryptographically random numbers. For example, Node.JS provides the following APIs:

// Generates a random number of bytes of `size` and triggers `callback`
crypto.randomBytes(size, callback);

// Asynchronously fills `buffer` with random values and triggers `callback`
crypto.randomFill(buffer[, offset[, size]], callback);

It is difficult to implement many cryptographic algorithms with the lack of such APIs.

Implementation

We would have to interface with rust-random and expose Lune APIs in a crypto built-in which achieves this. That would potentially also involve moving existing hashing methods present in the serde built-in, which would be a breaking change.

@Dekkonot
Copy link
Contributor

I am firmly against this for the same reason I'm again including password hashing algorithms in Lune. It feels like a mistake to give people the tools they need to make worse security decisions.

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

No branches or pull requests

2 participants