openssl
CLIGenerate random secrets, encode/decode base64, and hash files. Preinstalled on macOS and Linux.
Portable secrets, base64 and SHA-256 that behave the same on macOS and Linux
Verified commands
Executed by our harness on the platforms shown; the assertion checked the actual result, not just the exit code.
Generate a random secret (base64, 32 bytes)
openssl rand -base64 32Generate a random hex token (64 chars)
openssl rand -hex 32Base64-encode a file on a single line (portable)
openssl base64 -A -in file.txtCommon failures (1)
- base64: invalid option -- wmacOS base64 has no -w0; use openssl base64 -A which works everywhere
Base64-decode a string (portable)
echo 'aGVsbG8=' | openssl base64 -d -ASHA-256 of a file (portable)
openssl dgst -sha256 file.txtInstall
Homebrew
brew install opensslapt
sudo apt install opensslAgent notes
- When to use
- Filling NEXTAUTH_SECRET-style env vars, encoding credentials, checking downloads
- Quick examples
openssl rand -base64 32openssl dgst -sha256 file.txt
Use from an agent
curl -s https://clihub.com/api/tools/openssl | jq '.agentHints.provenRecipes[] | {task, command, verified}'Or call get_tool with slug openssl on the MCP server at https://clihub.com/mcp.