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

crypto/rsa: support for 64-bit E values #17970

Closed
akalin-keybase opened this issue Nov 17, 2016 · 4 comments
Closed

crypto/rsa: support for 64-bit E values #17970

akalin-keybase opened this issue Nov 17, 2016 · 4 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.

Comments

@akalin-keybase
Copy link

We at keybase have seen PGP keys in the wild that use exponents greater than signed 32-bits: keybase/go-crypto#8

Unfortunately, we've had to fork crypto/rsa and use that in our fork of golang.org/x/crypto/openpgp.

Ideally, we wouldn't have to do that. However, @agl, it looks like you deliberately limited it to 32 bits.

Would you accept a patch to change rsa.PublicKey.E to int64? If not, is there another solution you can think of?

@bradfitz bradfitz added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Nov 17, 2016
@minux
Copy link
Member

minux commented Nov 17, 2016 via email

@agl
Copy link
Contributor

agl commented Nov 17, 2016

It's never been the aim of the crypto libraries to support every thing that someone has managed to do somewhere. I'm sure that if E were 64 bit, someone will have turned out to have a yet larger public exponent.

Given that there is no reason to have exponents larger than 65537, and 99.9% of keys use either 3 or 65537, I don't think that this is something we want to spend time on I'm afraid.

And, although it's obviously your decision, I would recommend not forking crypto/rsa. If your barrier for supporting something is that it happened to work then I fear you'll end up with a huge mess. In this case, e=2869406037 is a rather smooth number for a public exponent. Perhaps it's fine (one can't tell without the private key) but you might be papering over a key generation bug here.

@agl agl closed this as completed Nov 17, 2016
@akalin-keybase
Copy link
Author

Ah, thanks. @rsc does this change your thinking re. there being enough reports to warrant polluting the API?

If we can't add an E64 field, then we'd be stuck with keeping our fork, unfortunately. :/

@akalin-keybase
Copy link
Author

@agl OK, thanks for the explanation!

@golang golang locked and limited conversation to collaborators Nov 17, 2017
@rsc rsc unassigned agl Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

5 participants