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

Raise default RSA bitlength to 4096 #2

Open
huhndev opened this issue Jun 3, 2020 · 5 comments
Open

Raise default RSA bitlength to 4096 #2

huhndev opened this issue Jun 3, 2020 · 5 comments

Comments

@huhndev
Copy link

huhndev commented Jun 3, 2020

Please raise the default RSA bitlength to 4096 to increase security and get better scores with tools like CryptCheck.

public_key:generate_key({rsa, 2048, 65537}).

@Neustradamus
Copy link

@prefiks: What do you think?

@bestperson-free
Copy link

I really really want to see this on my server)

@mremond mremond assigned jsautret and unassigned jsautret Jul 21, 2023
@jsautret
Copy link
Member

Increasing the RSA bit length to 4096 could significantly increase CPU usage, while the security gain is still limited.

Mozilla's recommendation is still 2048: https://wiki.mozilla.org/Security/Server_Side_TLS

Here is a quick benchmark run on an AWS t3.medium:

$ openssl speed rsa2048 rsa4096
Doing 2048 bits private rsa's for 10s: 14554 2048 bits private RSA's in 10.00s
Doing 2048 bits public rsa's for 10s: 472882 2048 bits public RSA's in 9.99s
Doing 4096 bits private rsa's for 10s: 2166 4096 bits private RSA's in 10.00s
Doing 4096 bits public rsa's for 10s: 139385 4096 bits public RSA's in 10.00s
OpenSSL 1.1.1n  15 Mar 2022
built on: Fri May 26 21:30:44 2023 UTC
options:bn(64,64) rc4(16x,int) des(int) aes(partial) blowfish(ptr)
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/openssl-FSeIwm/openssl-1.1.1n=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
                  sign    verify    sign/s verify/s
rsa 2048 bits 0.000687s 0.000021s   1455.4  47335.5
rsa 4096 bits 0.004617s 0.000072s    216.6  13938.5

@bestperson-free
Copy link

The load is understandable, and it should be left to the user's choice, maybe it's worth doing 3072 as a middle ground)

@Neustradamus
Copy link

@jsautret: With OpenSSL 3.2.0 and 3.3.0, what is the benchmark?

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

4 participants