

Generate DH params with a given length: openssl dhparam -out dhparams.pem Create certificate signing requests (CSR) List available EC curves, that OpenSSL library supports: openssl ecparam -list_curves

Print ECDSA key textual representation: openssl ec -in example.ec.key -text -noout curve is to be replaced with: prime256v1, secp384r1, secp521r1, or any other supported elliptic curve: openssl ecparam -genkey -name | openssl ec -out example.ec.key Remove passphrase from the key: openssl rsa -in example.key -out example.keyĮncrypt existing private key with a pass phrase: openssl rsa -des3 -in example.key -out example_with_pass.key If the key has a pass phrase, you’ll be prompted for it: openssl rsa -check -in example.key Generate new RSA key and encrypt with a pass phrase based on AES CBC 256 encryption: openssl genrsa -aes256 -out example.key Ĭheck your private key. Print textual representation of RSA key: openssl rsa -in example.key -text -noout

Print public key or modulus only: openssl rsa -in example.key -pubout openssl rsa -in example.key -noout -modulus Generate an RSA key: openssl genrsa -out example.key In the commands below, replace with the key size (For example, 2048, 4096, 8192). For example, I skip encryption and decryption, or using openssl for CA management. Surely, this is not a complete list, but it covers the most common use cases and includes those I’ve been working with.
OPENSSL CIPHERS HOW TO
man pages are not so helpful here, so often we just Google “openssl how to ” or look for some kind of “openssl cheatsheet” to recall the usage of a command and see examples. OpenSSL includes tonnes of features covering a broad range of use cases, and it’s difficult to remember its syntax for all of them and quite easy to get lost. When it comes to security-related tasks, like generating keys, CSRs, certificates, calculating digests, debugging TLS connections and other tasks related to PKI and HTTPS, you’d most likely end up using the OpenSSL tool.
