OpenSSL/Cheatsheet

From braindump
Revision as of 05:05, 1 December 2011 by Uroesch (talk | contribs) (Created page with "== Command line shortcuts == === Base64 === Encode openssl base64 < file.b64 > file.txt Decode openssl base64 -d < file.txt > file.b64 === MD5 === Checksum a file openssl ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Command line shortcuts

Base64

Encode

openssl base64 < file.b64 > file.txt

Decode

openssl base64 -d < file.txt > file.b64

MD5

Checksum a file

openssl md5 file

SHA1

Checksum a file

openssl sha1 file


Generate Passwords

Crypt

openssl passwd <password>

MD5 (for /etc/passwd and /etc/shadow)

openssl passwd -1 

File encryption

Encrypt

openssl enc -aes-256-cbc < file > file.aes
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:

Decrypt

openssl enc -d -aes-256-cbc -in file.aes > file 
enter aes-256-cbc decryption password: