Encryption Examples

echo -n “secretsecretIgottasecret” | openssl enc -base64 -e -aes-256-cbc -nosalt

openssl enc -aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc

openssl enc -aes-256-cbc -d -a -in secrets.txt.enc -out secrets.txt.new

Hashing with GPG
–print-md <algorithm>

Examples:
:gpg –print-md md5 test.txt
test.txt: 9A 0E 24 23 4F B4 76 81 82 81 10 4B 77 99 1A 85

:gpg –print-md sha1 test.txt
test.txt: 2D20 A03A B0F5 C835 2DA4 3DDA 7C60 CA0F 1D69 A55B

:gpg –print-mds test.txt
This will display a table of hash values based on the available algorithms.

:echo “password” | gpg –print-md md5
28 67 55 FA D0 48 69 CA 52 33 20 AC CE 0D C6 A4

Leave a Reply