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

Seed RSA Generator #61

Closed
sebastianbuechler opened this issue Sep 5, 2023 · 1 comment
Closed

Seed RSA Generator #61

sebastianbuechler opened this issue Sep 5, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@sebastianbuechler
Copy link

Is there a way to seed the RSA generator of this package like we can do with pointy castle: https://github.com/bcgit/pc-dart/blob/master/tutorials/rsa.md

If no, what determines the seed here?

@jerson
Copy link
Owner

jerson commented Sep 17, 2023

Hi @sebastianbuechler currently we don't support using a custom seed to geneate a key, currently we use rand.Reader from go

https://github.com/jerson/rsa-mobile/blob/master/rsa/generate.go#L16

From go docs:
Most applications should use [crypto/rand.Reader] as rand. Note that the
returned key does not depend deterministically on the bytes read from rand,
and may change between calls and/or between versions.

so after read more in deep it seems is something we can adjust to make it safer


it seems we should also allow to set a custom nprime value, which is 2 by default

From go docs:
The use of this function with a number of primes different from
two is not recommended for the above security, compatibility, and performance
reasons. Use GenerateKey instead.

@jerson jerson added the help wanted Extra attention is needed label Nov 18, 2023
@jerson jerson closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants