简体   繁体   中英

When generating an SSL key pair for SSH what is the largest number of bits (-b) you can use?

I have recently done some work to upgrade to the SSL keys for some webservices we consume. I did not initiate the work but its was to go from 1024 to 2048 bits.

When generating ssh keys I can specify the bit level(rate/depth?) with ssh-keygen -b 2048. But what are the benefits/deficits of a higher bit value? Are there any technical limits?

why are we not all generating ssl keys with a bit depth of 1 billion?

I'm going to assume the keys are RSA since 2048 is a common size for RSA (but non-existent for ECDSA or EdDSA).

But what are the benefits/deficits of a higher bit value?

The benefits are the "strength" of the key, to put it simply. Larger keys take longer to "crack". More specifically, in RSA, breaking a key requires factoring a very large number. The larger the number is, the harder it is to factor. This the the extent of what we know about factoring numbers, which is that it cannot be done in polynomial time using technology that is readily available.

Larger keys can perform slower, and require more memory to use. However, 2048 is considered the lowest "safe" size for RSA.

Are there any technical limits?

It depends on what is using a key. Speaking from experience, keys bigger than 4096 start running in to software problems because the key is too large.

why are we not all generating ssl keys with a bit depth of 1 billion?

Well a 100 MB-ish key would take a lot of memory to use. Secondly, RSA keys are not completely random numbers. They are made up of two prime numbers, p & q, which produce n, the modulus. Generating primes this large is quite a difficult task.

Finally, there is little security benefit once you go beyond a certain key size.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM