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

docs(how-to): replace crypto-js with node's crypto module for random number generation in passwordless auth #11568

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

antonmoiseev
Copy link
Contributor

@antonmoiseev antonmoiseev commented Sep 15, 2024

This is the last remaining place in the guide where 3rd-party crypto-js package is used. Replaced crypto-js with node's crypto module to simplify the code and get rid of external dependency.

One thing I'm not certain about is how proposed changes compare with the existing solution from the security point of view. crypto.randomInt() should be secure, but after generating a number I padStart the value with "0" which may reduce randomness I guess. However the same is done for crypto-js generated values as well, so I would assume it shouldn't be less secure.

This is the last remaining place in the guide where 3rd-party crypto-js package is used. Replaced with crypto-js with node's crypto module to simplify the code and get rid of external dependency.

One thing I'm not certain about is how proposed changes compare with the existing solution from the security point of view.  `crypto.randomInt()` should be secure, but after generating a number I padStart the value with "0" which may reduce randomness I guess. However the same is done for crypto-js generated values as well, so I would assume it shouldn't be less secure.
@Tobbe Tobbe added release:docs This PR only updates docs changesets-ok Override the changesets check labels Sep 15, 2024
@Tobbe Tobbe added this to the next-release-patch milestone Sep 15, 2024
@Tobbe Tobbe merged commit 187bc70 into redwoodjs:main Sep 16, 2024
45 checks passed
Josh-Walker-GM pushed a commit that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:docs This PR only updates docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants