openssl - OpenSSL command line tool

openssl command [ command_opts ] [ command_args ]

openssl [ list-standard-commands | list-message-digest-commands | list-cipher-commands ]

openssl no-command

Cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and related cryptography standards required by them. Uses various cryptography functions crypto library to:

Enters command mode prompting with OPENSSL> if no options are give.

The pseudo-command no-command tests if a command is available returns 0 (success, i.e. "Yes, no command like that is available") and prints no-command; otherwise it returns 1 and prints command.

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.
(no-command is not able to detect pseudo-commands such as quit, list-…-commands .)

> openssl no-speed
> echo $?
> openssl no-x509
> openssl no-x508
> echo $?

Standard commands

asn1parse Parse an ASN.1 sequence.
ca Certificate Authority (CA) Management.
ciphers Cipher Suite Description Determination.
crl Certificate Revocation List (CRL) Management.
crl2pkcs7 CRL to PKCS#7 Conversion.
dgst Message Digest Calculation.
dh Diffie-Hellman Parameter Management. Obsoleted by dhparam.
dsa DSA Data Management.
dsaparam DSA Parameter Generation.
enc Encoding with Ciphers.
errstr Error Number to Error String Conversion.
dhparam Generation and Management of Diffie-Hellman Parameters.
gendh Generation of Diffie-Hellman Parameters. Obsoleted by dhparam.
gendsa Generation of DSA Parameters.
genrsa Generation of RSA Parameters.
ocsp Online Certificate Status Protocol utility.
passwd Generation of hashed passwords.
pkcs12 PKCS#12 Data Management.
pkcs7 PKCS#7 Data Management.
rand Generate pseudo-random bytes.
req X.509 Certificate Signing Request (CSR) Management.
rsa RSA Data Management.
rsautl RSA utility for signing, verification, encryption, and decryption.
s_client 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 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. sample output
version OpenSSL Version Information. (6/4/12 on Mac OS X OpenSSL 0.9.8r 8 Feb 2011)
verify X.509 Certificate Verification.
x509 X.509 Certificate Data Management.

Message digest commands

md2 md5 mdc2 rmd160 sha sha1 sha224 sha256 sha384 sha512

Encoding and cipher commands

See the enc command for more details
Base64 Encoding  base64    
Blowfish    bf           bf-cbc      bf-cfb      bf-ecb      bf-ofb 
CAST        cast         cast-cbc    
CAST5       cast5-cbc cast5-cfb cast5-ecb cast5-ofb 
DES         des des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ofb 
Triple-DES  des3 desx des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb 
IDEA        idea idea-cbc idea-cfb idea-ecb idea-ofb 
RC2         rc2 rc2-cbc rc2-cfb rc2-ecb rc2-ofb 
RC4         rc4       
RC5         rc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb 

Pass Phrase arguments

-passin and -passout are used for input and output passwords . allowing the password to be obtained from a variety of sources. a single argument .

If a password is required but not provided the user is prompted to enter one, typically from the terminal without echoing

pass:password the actual password is password. Since the password is visible to utilities (like ps ) this form should be avoided.
env:var obtain the password from the environment variable var. Since the environment of other processes is visible on certain platforms (e.g. ps ) this option should be used with caution.
file:pathname the first line of pathname is the password.
If the same pathname argument is supplied to -passin and -passout the first line will be used for the input password and the next line for the output password.

pathname may refer to a device or named pipe.

fd:n read the password from the file descriptor n, used to send the data via a pipe

Generate MD5 checksum example:
> openssl dgst kav_rescue_10.iso
MD5(kav_rescue_10.iso)= b40962e90183fcbcba89f4183c833405

See Also

asn1parse, ca, config, , crl2pkcs7, dgst, dhparam, dsa, dsaparam, enc, gendsa, genrsa, nseq, openssl, passwd, pkcs12, pkcs7, pkcs8, rand, req, rsa, rsautl, s_client, s_server, s_time, smime, spkac, verify, version, x509, crypto(3), ssl(3)

Message Digest commands

(see the `dgst' command for more details) md2 md4 md5 rmd160 sha sha1