OpenSSL

Cryptography toolkit for keys, hashes and TLS

openssl Security and cryptography Apache-2.0

About

OpenSSL is a cryptography toolkit: random data, checksums, certificates and file encryption. Use it to make a self-signed certificate, verify a download, or inspect a TLS handshake. The Termux package is openssl-tool.

Install it

pkg install openssl-tool

Run this inside Termux. If the package is already present, pkg will say so and do nothing.

Commands worth knowing

6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.

openssl rand -base64 32 Generate 32 bytes of random data and print them in base64. A common way to make a token.
openssl dgst -sha256 notes.txt Compute a SHA-256 checksum. Confirms a file has not changed.
openssl req -new -x509 -key key.pem -out cert.pem -days 365 Create a self-signed certificate for a service on your own network.
openssl enc -aes-256-cbc -salt -in notes.txt -out notes.enc Encrypt a file with a passphrase. Store it or send it safely.
openssl s_client -connect example.com:443 Inspect the TLS handshake and certificate chain a server presents.
openssl x509 -in cert.pem -text -noout Decode a certificate and read its subject, issuer and validity dates.

Worked example

Run openssl rand -base64 32 and this is what you should see.

termux
$ openssl rand -base64 32
K7gN2vQp8xLm3TzR9wYsB4cD6eF1hJ0k
Q2wE5rT8yU1iO4pA7sD3fG6hJ9kL0zX
C5vB8nM2qW4eR7tY1uI3oP6aS9dF0gH

Developed by

The OpenSSL Project · released under Apache-2.0.