OPENSSL(1ossl)

๐Ÿ“ฆ
version 15.1 ยท 2 versions
, in freebsd 15.1

๐Ÿ’– NAME ๐Ÿ’–

openssl โ€” the OpenSSL command line program, aka the girlboss of cryptography toolkits, brought to you by the OpenSSL manual (section 1ossl, bestie, write it down) โœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

openssl command [ options ... ] [ parameters ... ]
openssl no-XXX [ options ]
openssl -help | -version

๐ŸŒธ DESCRIPTION ๐ŸŒธ

Okay so picture this: OpenSSL is a whole cryptography toolkit that implements the Secure Sockets Layer (SSL) and Transport Layer Security (TLS) network protocols, plus all the related cryptography standards those protocols require. Iconic, honestly.

The openssl program is the command line program that lets you use all the various cryptography functions of OpenSSL's crypto library straight from your shell. It's giving Swiss Army knife but make it crypto. You can use it for:

  • Creation and management of private keys, public keys and parameters
  • Public key cryptographic operations
  • Creation of X.509 certificates, CSRs and CRLs
  • Calculation of Message Digests and Message Authentication Codes
  • Encryption and Decryption with Ciphers
  • SSL/TLS Client and Server Tests
  • Handling of S/MIME signed or encrypted mail
  • Timestamp requests, generation and verification

No cap, that's a lot of jobs. Main character energy fr fr ๐Ÿ‘‘


๐Ÿ‘‘ COMMAND SUMMARY ๐Ÿ‘‘

The openssl program provides a rich variety of commands (that's command in the "SYNOPSIS" above, iykyk). Each command can have many options and argument parameters, shown above as options and parameters.

Detailed documentation and use cases for most standard subcommands are available (e.g., openssl-x509(1)). And if you ever forget what the subcommands even are, the subcommand openssl-list(1) may be used to list subcommands. Slay.

The command no-XXX tests whether a command of the specified name is available. Here's the vibe check:

  • If no command named XXX exists, it returns 0 (success) and prints no-XXX.
  • Otherwise it returns 1 and prints XXX.

In both cases, the output goes to stdout and nothing is printed to stderr. Additional command line arguments are always ignored. And since for each cipher there is a command of the same name, this provides an easy way for shell scripts to test for the availability of ciphers in the openssl program.

Heads up bestie: no-XXX is not able to detect pseudo-commands such as quit, list, or no-XXX itself. She has limits ๐Ÿ’€

๐ŸŽ€ Configuration Option ๐ŸŽ€

Many commands use an external configuration file for some or all of their arguments, and have a -config option to specify that file. The default name of the file is openssl.cnf, living in the default certificate storage area โ€” which you can figure out from the openssl-version(1) command using the -d or -a option. The environment variable OPENSSL_CONF can be used to specify a different file location, or to disable loading a configuration (just use the empty string for that, sneaky but valid).

Among others, the configuration file can be used to load modules and to specify parameters for generating certificates and random numbers. See config(5) for the details, because there are details.

๐ŸŒˆ Standard Commands ๐ŸŒˆ

  • asn1parse โ€” Parse an ASN.1 sequence.
  • ca โ€” Certificate Authority (CA) Management.
  • ciphers โ€” Cipher Suite Description Determination.
  • cms โ€” CMS (Cryptographic Message Syntax) command.
  • crl โ€” Certificate Revocation List (CRL) Management.
  • crl2pkcs7 โ€” CRL to PKCS#7 Conversion.
  • dgst โ€” Message Digest calculation. MAC calculations are superseded by openssl-mac(1).
  • dhparam โ€” Generation and Management of Diffie-Hellman Parameters. Superseded by openssl-genpkey(1) and openssl-pkeyparam(1).
  • dsa โ€” DSA Data Management.
  • dsaparam โ€” DSA Parameter Generation and Management. Superseded by openssl-genpkey(1) and openssl-pkeyparam(1).
  • ec โ€” EC (Elliptic curve) key processing.
  • ecparam โ€” EC parameter manipulation and generation.
  • enc โ€” Encryption, decryption, and encoding.
  • engine โ€” Engine (loadable module) information and manipulation.
  • errstr โ€” Error Number to Error String Conversion.
  • fipsinstall โ€” FIPS configuration installation.
  • gendsa โ€” Generation of DSA Private Key from Parameters. Superseded by openssl-genpkey(1) and openssl-pkey(1).
  • genpkey โ€” Generation of Private Key or Parameters.
  • genrsa โ€” Generation of RSA Private Key. Superseded by openssl-genpkey(1).
  • help โ€” Display information about a command's options.
  • info โ€” Display diverse information built into the OpenSSL libraries.
  • kdf โ€” Key Derivation Functions.
  • list โ€” List algorithms and features.
  • mac โ€” Message Authentication Code Calculation.
  • nseq โ€” Create or examine a Netscape certificate sequence.
  • ocsp โ€” Online Certificate Status Protocol command.
  • passwd โ€” Generation of hashed passwords.
  • pkcs12 โ€” PKCS#12 Data Management.
  • pkcs7 โ€” PKCS#7 Data Management.
  • pkcs8 โ€” PKCS#8 format private key conversion command.
  • pkey โ€” Public and private key management.
  • pkeyparam โ€” Public key algorithm parameter management.
  • pkeyutl โ€” Public key algorithm cryptographic operation command.
  • prime โ€” Compute prime numbers.
  • rand โ€” Generate pseudo-random bytes.
  • rehash โ€” Create symbolic links to certificate and CRL files named by the hash values.
  • req โ€” PKCS#10 X.509 Certificate Signing Request (CSR) Management.
  • rsa โ€” RSA key management.
  • rsautl โ€” RSA command for signing, verification, encryption, and decryption. Superseded by openssl-pkeyutl(1).
  • s_client โ€” This implements a generic SSL/TLS client which can establish a transparent connection to a remote server speaking SSL/TLS. It's intended for testing purposes only and provides only rudimentary interface functionality but internally uses mostly all functionality of the OpenSSL ssl library.
  • s_server โ€” This implements a generic SSL/TLS server which accepts connections from remote clients speaking SSL/TLS. It's intended for testing purposes only and provides only rudimentary interface functionality but internally uses mostly all functionality of the OpenSSL ssl library. It provides both an own command line oriented protocol for testing SSL functions and a simple HTTP response facility to emulate an SSL/TLS-aware webserver.
  • s_time โ€” SSL Connection Timer.
  • sess_id โ€” SSL Session Data Management.
  • smime โ€” S/MIME mail processing.
  • speed โ€” Algorithm Speed Measurement.
  • spkac โ€” SPKAC printing and generating command.
  • srp โ€” Maintain SRP password file. This command is deprecated ๐Ÿซ 
  • storeutl โ€” Command to list and display certificates, keys, CRLs, etc.
  • ts โ€” Time Stamping Authority command.
  • verify โ€” X.509 Certificate Verification. See also the openssl-verification-options(1) manual page.
  • version โ€” OpenSSL Version Information.
  • x509 โ€” X.509 Certificate Data Management.

๐Ÿงš Message Digest Commands ๐Ÿงš

  • blake2b512 โ€” BLAKE2b-512 Digest
  • blake2s256 โ€” BLAKE2s-256 Digest
  • md2 โ€” MD2 Digest
  • md4 โ€” MD4 Digest
  • md5 โ€” MD5 Digest
  • mdc2 โ€” MDC2 Digest
  • rmd160 โ€” RMD-160 Digest
  • sha1 โ€” SHA-1 Digest
  • sha224 โ€” SHA-2 224 Digest
  • sha256 โ€” SHA-2 256 Digest
  • sha384 โ€” SHA-2 384 Digest
  • sha512 โ€” SHA-2 512 Digest
  • sha3-224 โ€” SHA-3 224 Digest
  • sha3-256 โ€” SHA-3 256 Digest
  • sha3-384 โ€” SHA-3 384 Digest
  • sha3-512 โ€” SHA-3 512 Digest
  • keccak-224 โ€” KECCAK 224 Digest
  • keccak-256 โ€” KECCAK 256 Digest
  • keccak-384 โ€” KECCAK 384 Digest
  • keccak-512 โ€” KECCAK 512 Digest
  • shake128 โ€” SHA-3 SHAKE128 Digest
  • shake256 โ€” SHA-3 SHAKE256 Digest
  • sm3 โ€” SM3 Digest

๐Ÿ’… Encryption, Decryption, and Encoding Commands ๐Ÿ’…

The following aliases provide convenient access to the most used encodings and ciphers. Convenient! We love a shortcut.

Depending on how OpenSSL was configured and built, not all ciphers listed here may be present. See openssl-enc(1) for more information. Building choices are real, bestie ๐Ÿ˜ญ
  • aes128, aes-128-cbc, aes-128-cfb, aes-128-ctr, aes-128-ecb, aes-128-ofb โ€” AES-128 Cipher
  • aes192, aes-192-cbc, aes-192-cfb, aes-192-ctr, aes-192-ecb, aes-192-ofb โ€” AES-192 Cipher
  • aes256, aes-256-cbc, aes-256-cfb, aes-256-ctr, aes-256-ecb, aes-256-ofb โ€” AES-256 Cipher
  • aria128, aria-128-cbc, aria-128-cfb, aria-128-ctr, aria-128-ecb, aria-128-ofb โ€” Aria-128 Cipher
  • aria192, aria-192-cbc, aria-192-cfb, aria-192-ctr, aria-192-ecb, aria-192-ofb โ€” Aria-192 Cipher
  • aria256, aria-256-cbc, aria-256-cfb, aria-256-ctr, aria-256-ecb, aria-256-ofb โ€” Aria-256 Cipher
  • base64 โ€” Base64 Encoding
  • bf, bf-cbc, bf-cfb, bf-ecb, bf-ofb โ€” Blowfish Cipher
  • camellia128, camellia-128-cbc, camellia-128-cfb, camellia-128-ctr, camellia-128-ecb, camellia-128-ofb โ€” Camellia-128 Cipher
  • camellia192, camellia-192-cbc, camellia-192-cfb, camellia-192-ctr, camellia-192-ecb, camellia-192-ofb โ€” Camellia-192 Cipher
  • camellia256, camellia-256-cbc, camellia-256-cfb, camellia-256-ctr, camellia-256-ecb, camellia-256-ofb โ€” Camellia-256 Cipher
  • cast, cast-cbc โ€” CAST Cipher
  • cast5-cbc, cast5-cfb, cast5-ecb, cast5-ofb โ€” CAST5 Cipher
  • chacha20 โ€” Chacha20 Cipher
  • des, des-cbc, des-cfb, des-ecb, des-ede, des-ede-cbc, des-ede-cfb, des-ede-ofb, des-ofb โ€” DES Cipher
  • des3, desx, des-ede3, des-ede3-cbc, des-ede3-cfb, des-ede3-ofb โ€” Triple-DES Cipher
  • idea, idea-cbc, idea-cfb, idea-ecb, idea-ofb โ€” IDEA Cipher
  • rc2, rc2-cbc, rc2-cfb, rc2-ecb, rc2-ofb โ€” RC2 Cipher
  • rc4 โ€” RC4 Cipher
  • rc5, rc5-cbc, rc5-cfb, rc5-ecb, rc5-ofb โ€” RC5 Cipher
  • seed, seed-cbc, seed-cfb, seed-ecb, seed-ofb โ€” SEED Cipher
  • sm4, sm4-cbc, sm4-cfb, sm4-ctr, sm4-ecb, sm4-ofb โ€” SM4 Cipher

โœจ OPTIONS โœจ

Okay bestie, so the options you actually get depend on which command you're running โ€” every command has its own little menu. But this section is all about the ones that behave the same basically everywhere. ๐ŸŽ€


๐ŸŒธ Program Options

These ones you can throw in without naming a command, and they'll just give you help or version tea. โ˜•

  • -help โ€” gives you a terse summary of, like, all the options. Want more detail? Every command also has its own -help flag. Also accepts --help, because we love a flexible icon.
  • -version โ€” gives you a terse summary of the openssl program version. For the full scoop, go see openssl-version(1). Also accepts --version. ๐Ÿ’…

๐Ÿฆ‹ Common Options

  • -help โ€” and if an option takes an argument, the "type" of that argument gets shown too. Helpful queen behavior, honestly.
  • -- โ€” this one terminates the list of options. It's mostly useful when one of your filename parameters starts with a minus sign, so it doesn't get mistaken for a flag:
openssl verify [flags...] -- -cert1.pem...

๐ŸŽ€ Format Options

See the openssl-format-options(1) manual page. (That's the whole vibe, no cap.) โœจ


๐Ÿ’œ Pass Phrase Options

See the openssl-passphrase-options(1) manual page. ๐Ÿซถ


๐Ÿ“ Random State Options

Okay so storytime, bestie. ๐Ÿ“– Prior to OpenSSL 1.1.1, it was super common for applications to store info about the state of the random-number generator in a file โ€” loaded at startup, rewritten on exit, the whole routine. On modern operating systems this is generally no longer necessary, because OpenSSL seeds itself from a trusted entropy source provided by the operating system. Iconic. But these flags are still supported for special platforms or circumstances that might require them.

Heads up: it's generally an error to use the same seed file more than once, and every use of -rand should be paired with -writerand. Match them up like outfits, okay? ๐Ÿ‘—
  • -rand files โ€” a file (or files!) containing random data used to seed the random number generator. You can specify multiple files separated by an OS-dependent character. The separator is ; for MS-Windows, , for OpenVMS, and : for all others. Another way to specify multiple files is to just repeat this flag with different filenames.
  • -writerand file โ€” writes the seed data to the specified file upon exit. That file can then be used in a subsequent command invocation. Cute and reusable. ๐ŸŽ€

๐Ÿ”ฅ Certificate Verification Options

See the openssl-verification-options(1) manual page. ๐Ÿ’–


๐ŸŒˆ Name Format Options

See the openssl-namedisplay-options(1) manual page. ๐Ÿฆ‹


โญ TLS Version Options

Several commands use SSL, TLS, or DTLS. By default, the commands use TLS โ€” clients offer the lowest and highest protocol version they support, and servers pick the highest version the client offers that the server also supports. It's giving negotiation, it's giving compromise. ๐Ÿค

The options below let you limit which protocol versions get used, and whether it's TCP (SSL and TLS) or UDP (DTLS). Note that not all protocols and flags may be available, depending on how OpenSSL was built. Check your vibe, basically.

  • -ssl3, -tls1, -tls1_1, -tls1_2, -tls1_3, -no_ssl3, -no_tls1, -no_tls1_1, -no_tls1_2, -no_tls1_3 โ€” these options require or disable the use of the specified SSL or TLS protocols. When a specific TLS version is required, only that version will be offered or accepted. Only one specific protocol can be given, and it cannot be combined with any of the no_ options. Also heads up: the no_* options do not work with the s_time and ciphers commands, but they do work with s_client and s_server. ๐Ÿ˜ญ (we don't make the rules)
  • -dtls, -dtls1, -dtls1_2 โ€” these specify to use DTLS instead of TLS. With -dtls, clients will negotiate any supported DTLS protocol version. Use -dtls1 or -dtls1_2 to support only DTLS1.0 or DTLS1.2, respectively. Pick your fighter. โš”๏ธ

๐Ÿ’… Engine Options

  • -engine id โ€” loads the engine identified by id and uses all the methods it implements (algorithms, key storage, etc.), unless it says otherwise in the command-specific documentation, or it's configured to do so, as described in "Engine Configuration" in config(5).

The engine will be used for key ids specified with -key and similar options when an option like -keyform engine is given.

A special case is the "loader_attic" engine โ€” that one is meant just for internal OpenSSL testing purposes and supports loading keys, parameters, certificates, and CRLs from files. When this engine is used, files with such credentials are read via this engine. Using the "file:" schema is optional; a plain file (path) name will do.

Options specifying keys, like -key and similar, can use the generic OpenSSL engine key loading URI scheme "org.openssl.engine:" to retrieve private keys and public keys. The URI syntax is as follows, in simplified form:

org.openssl.engine:{engineid}:{keyid}

Where "{engineid}" is the identity/name of the engine, and "{keyid}" is a key identifier that's acceptable by that engine. For example, when using an engine that interfaces against a PKCS#11 implementation, the generic key URI would be something like this (this happens to be an example for the PKCS#11 engine that's part of OpenSC):

-key org.openssl.engine:pkcs11:label_some-private-key

As a third possibility, for engines and providers that have implemented their own OSSL_STORE_LOADER(3), "org.openssl.engine:" should not be necessary. For a PKCS#11 implementation that has implemented such a loader, the PKCS#11 URI as defined in RFC 7512 should be possible to use directly:

-key pkcs11:object=some-private-key;pin-value=1234

๐Ÿงš Provider Options

  • -provider name โ€” load and initialize the provider identified by name. The name can also be a path to the provider module. In that case the provider name will be the specified path and not just the provider module name. Interpretation of relative paths is platform specific. The configured "MODULESDIR" path, the OPENSSL_MODULES environment variable, or the path specified by -provider-path is prepended to relative paths. See provider(7) for a more detailed description. โœจ
  • -provider-path path โ€” specifies the search path that is to be used for looking for providers. Equivalently, the OPENSSL_MODULES environment variable may be set. Same energy, different outfit.
  • -provparam [name:]key=value โ€” set configuration parameter key to value val in provider name (optional). If name is not specified, the setting will be applied to all loaded providers. This option can be specified multiple times, to set multiple parameters. Options that specify nondefault providers to load should precede this option if the setting is intended to apply to the to-be-loaded providers. Parameters that only affect provider initialisation must, for now, be set in the configuration file โ€” only parameters that are also queried as needed later have any effect when set via this interface. Only UTF8-string-valued parameters are supported. See the documentation of the specific provider and associated algorithms for any supported parameters.
  • -propquery propq โ€” specifies the property query clause to be used when fetching algorithms from the loaded providers. See property(7) for a more detailed description. ๐Ÿ”

๐ŸŒ ENVIRONMENT

The OpenSSL libraries can take some configuration parameters from the environment. Very main character of them. ๐Ÿ’ซ


๐Ÿ‘€ SEE ALSO

Okay, deep breath, this is a long list, but every single one is here because it slays:

openssl-asn1parse(1), openssl-ca(1), openssl-ciphers(1), openssl-cms(1), openssl-crl(1), openssl-crl2pkcs7(1), openssl-dgst(1), openssl-dhparam(1), openssl-dsa(1), openssl-dsaparam(1), openssl-ec(1), openssl-ecparam(1), openssl-enc(1), openssl-engine(1), openssl-errstr(1), openssl-gendsa(1), openssl-genpkey(1), openssl-genrsa(1), openssl-kdf(1), openssl-list(1), openssl-mac(1), openssl-nseq(1), openssl-ocsp(1), openssl-passwd(1), openssl-pkcs12(1), openssl-pkcs7(1), openssl-pkcs8(1), openssl-pkey(1), openssl-pkeyparam(1), openssl-pkeyutl(1), openssl-prime(1), openssl-rand(1), openssl-rehash(1), openssl-req(1), openssl-rsa(1), openssl-rsautl(1), openssl-s_client(1), openssl-s_server(1), openssl-s_time(1), openssl-sess_id(1), openssl-smime(1), openssl-speed(1), openssl-spkac(1), openssl-srp(1), openssl-storeutl(1), openssl-ts(1), openssl-verify(1), openssl-version(1), openssl-x509(1), config(5), crypto(7), openssl-env(7). ssl(7), x509v3_config(5)

(Yes, that's a lot of reading. Hydrate first. ๐Ÿ’ง)


๐Ÿ“œ HISTORY

  • The list -XXX-algorithms options were added in OpenSSL 1.0.0; for notes on the availability of other commands, see their individual manual pages.
  • The -issuer_checks option is deprecated as of OpenSSL 1.1.0 and is silently ignored. It's giving ghosted. ๐Ÿ’€
  • The -xcertform and -xkeyform options are obsolete since OpenSSL 3.0 and have no effect. RIP bestie, you did nothing.
  • The interactive mode โ€” which could be invoked by running "openssl" with no further arguments โ€” was removed in OpenSSL 3.0, and running that program with no arguments is now equivalent to "openssl help". Character development, honestly. ๐Ÿฆ‹

Copyright 2000-2025 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>.


And that's a wrap, bestie! ๐ŸŽ€ This whole page is from OpenSSL 3.5.6, dated 2026-04-07 โ€” go off, version queen. Now close the tab and go touch some grass, you've earned it. ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from