Skip to content

genpkey generates short 1024-bit RSA keys by default? #8737

@thanatos

Description

@thanatos

The default key size for an RSA key generated with genpkey is 1024 bits:

» openssl genpkey -algorithm RSA 2>/dev/null | openssl rsa -noout -text | grep RSA
RSA Private-Key: (1024 bit, 2 primes)

The older (deprecated?) genrsa has a different default, of 2048 bits:

» openssl genrsa 2>/dev/null | openssl rsa -noout -text | grep RSA
RSA Private-Key: (2048 bit, 2 primes)

My understanding is that 1024-bit long keys are not considered secure these days. (And that CAs have required at least 2048 bits keys for RSA keys since 2014.) The difference between genrsa and genpkey makes me think this is a mistake. (I suspect genrsa, despite being superseded, is much more commonly used due to the number of examples on the Internet that use it.)

I am using OpenSSL v1.1.1b on Arch Linux:

» openssl version
OpenSSL 1.1.1b  26 Feb 2019

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions