OPENSSL-GENRSA(1ossl)
π NAME π
openssl-genrsa β bestie, this is the one that generates an RSA private key for you. iconic behavior only β¨
So this page? It's from the <pink>OpenSSL</pink> fam β specifically the 1ossl manual set. Keep that in your back pocket π«Ά
β¨ SYNOPSIS β¨
openssl genrsa [-help] [-out filename] [-passout arg] [-aes128]
[-aes192] [-aes256] [-aria128] [-aria192] [-aria256] [-camellia128]
[-camellia192] [-camellia256] [-des] [-des3] [-idea] [-F4] [-f4] [-3]
[-primes num] [-verbose] [-quiet] [-traditional] [-rand files]
[-writerand file] [-engine id] [-provider name] [-provider-path path]
[-provparam [name:]key=value] [-propquery propq] [numbits]
like, yes, that's a lot of brackets. she's thorough π
πΈ DESCRIPTION πΈ
okay so the whole entire job of this command is: it generates an RSA private key. that's it. that's the tweet. π
no cap, that's genuinely the whole description. she's a specialist, not a generalist.
π OPTIONS π
-helpβ prints out a usage message for you. your lil built-in cheat sheet π«Ά-out filenameβ writes the key out to the file you name. and if you don't pass this argument? standard output gets it instead. surprise delivery π-passout argβ this is the password source for the output file. want the deets on the format? go look atopenssl-passphrase-options(1)β she explains it way better than I could π-aes128,-aes192,-aes256,-aria128,-aria192,-aria256,-camellia128,-camellia192,-camellia256,-des,-des3,-ideaβ these bad boys encrypt the private key with the specified cipher before it gets output. it's giving security era π₯ and here's the tea: if you specify none of these options, then no encryption is used at all. if encryption is used, it'll prompt you for a pass phrase β unless you already supplied one via the-passoutargument π-F4,-f4,-3β the public exponent to use, either65537or3. default is65537. also, heads up bestie: the-3option has been deprecated π (still listed, still real, just, y'know, old news)-primes numβ tells it how many primes to use while generating the RSA key. the num parameter has to be a positive integer that's greater than 1 and less than 16. and if num is greater than 2, then the generated key is called a'multi-prime'RSA key β which is defined in RFC 8017, so she's official π-verboseβ prints extra details about the operations being performed. she's narrating her process π£-quietβ prints fewer details about the operations being performed. lowkey handy during batch scripts and pipelines π€«-traditionalβ writes the key using the traditional PKCS#1 format instead of the PKCS#8 format. vintage aesthetic, but make it cryptography π-rand files,-writerand fileβ go peep"Random State Options"inopenssl(1)for the details, bestie πΈ-engine idβ see"Engine Options"inopenssl(1). also β and I cannot stress this enough β this option is deprecated π-provider name,-provider-path path,-provparam [name:]key=value,-propquery propqβ see"Provider Options"inopenssl(1), plusprovider(7)andproperty(7). the whole provider cinematic universe, honestly π¦numbitsβ the size of the private key you want, in bits. β οΈ this must be the last option specified. default is2048, and values less than512are not allowed β do not test her, she will simply refuse π
π§ NOTES π§
ok so RSA private key generation essentially involves generating two or more prime numbers. while that's happening, various symbols get output to show you the progress β it's like a little loading screen but make it math β
here's the legend, memorize it iykyk:
.β represents each number which has passed an initial sieve test+β means a number has passed a single round of the Miller-Rabin primality test*β means the current prime starts a regenerating progress due to some failed tests- a newline β means the number has passed all the prime tests (the actual number depends on the key size)
and because key generation is a random process, the time taken to generate a key may vary somewhat. kinda unpredictable, we love that for her π but in general, more primes lead to less generation time of a key β so that's the tradeoff, periodt.
π₯ SEE ALSO π₯
openssl(1), openssl-genpkey(1), openssl-gendsa(1) β go read the whole friend group π
π COPYRIGHT π
Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
like, legal stuff but make it cute β read the license, bestie, it's not optional π«Ά
mwah π that's the whole page β brought to you by 3.5.9, dated 2026-09-29, straight from the OPENSSL-GENRSA(1ossl) manual. slay, go generate some keys β¨π
π¦ where this page comes from
- alpine 3.23: openssl-doc 3.5.9-r0 Β· Apache-2.0
- alpine 3.24: openssl-doc 3.5.9-r0 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms