Last active
July 28, 2023 14:10
-
-
Save corvax19/4275922 to your computer and use it in GitHub Desktop.
[/linux/openSSL] Simple text #encryption/#decryption with #openssl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -n "That's the text"|openssl enc -e -aes-256-cbc -a | |
Encrypt with interactive password. Encrypted message is base64-encoded afterwards. | |
echo -n "That's the text"|openssl enc -e -aes-256-cbc -a -k "MySuperPassword" | |
Encrypt with specified password. Encrypted message is base64-encoded afterwards. | |
echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc | |
Base-64 decode and decrypt message with interactive password. | |
echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc -k "MySuperPassword" | |
Base-64 decode and decrypt message with specified password. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your decoding examples don't include
-a
so wouldn't Base64 decode the input string, right? Also worth noting that you should now include the password key function and iteration count as well, e.g.openssl enc -e -aes-256-cbc -pbkdf2 -iter 1234 -a -k <password>