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

2047 vs. 2048 #41

Closed
paul-eeoc opened this issue Jan 6, 2022 · 2 comments · Fixed by skjolber/java-jwt-benchmark#33
Closed

2047 vs. 2048 #41

paul-eeoc opened this issue Jan 6, 2022 · 2 comments · Fixed by skjolber/java-jwt-benchmark#33
Milestone

Comments

@paul-eeoc
Copy link

Using this public key (see below), I get this error:
Key length of [2047] is less than the required key length of 2048 bits
with this java snippet of code:
RSAVerifier verifier = RSAVerifier.newVerifier(publicKeyContent);
Can we have an option or parameter to allow 2047 as well as 2048? Or a parameter to turn off this key length check?
See this article
https://randomoracle.wordpress.com/2019/12/04/off-by-one-the-curious-case-of-2047-bit-rsa-keys/

-----BEGIN PUBLIC KEY-----
MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBxbF2xqMaW05S4+qgaWUya
6e2QfXt7hNRFW/z7PlygU5D4lol6dfCiTEkgCHCiuYU7T7tmzNhqlMxKf8cj0XSo
UDvhmAfB9+pLx5hVsqHQlAJA4f5/q3oj7/bT6exfK6xsDlSAlAuxMy/gwVx8Zcbw
zxjFcK6S4o75Lr1zK40MfGKFOcbaNs/ma7F59R5ttXU0Y1gTnup2DZx5Z9TudWsB
jJoAhXV4dZN8uGeneD/2raLbKHWT1lCWzCwSwTSvMefRLwxCxfX+eXA0Vle9zPT8
P8xr2QXOJ7u4VPYjwrQdCpPbPdOENiIBhb0dwU7hrjGjRDZ3O2z1x7VbC7B5oX5b
AgMBAAE=
-----END PUBLIC KEY-----

@robotdan
Copy link
Member

robotdan commented Apr 2, 2022

Interesting, it looks like it is possible to generate a key that is 2047 bits.. perhaps I just need to allow either as they both seem to be ok.

robotdan added a commit that referenced this issue Apr 2, 2022
@robotdan
Copy link
Member

robotdan commented Apr 2, 2022

Fixed in 5.1.1

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

Successfully merging a pull request may close this issue.

2 participants