Created
May 8, 2025 03:23
-
-
Save xiongjia/cc179656e09576915690c45e2993cfea to your computer and use it in GitHub Desktop.
AES for bash
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
#!/bin/bash | |
msg_content="Test" | |
enc_aes_key="pass" | |
enc_content=`echo -n "${msg_content}" | openssl enc -aes-128-ecb -a -iter 100 -pbkdf2 -e -pass pass:"${enc_aes_key}" -nosalt 2>/dev/null` | |
decrypt_content=`echo "${enc_content}" | openssl enc -aes-128-ecb -a -iter 100 -pbkdf2 -d -pass pass:"${enc_aes_key}" -nosalt 2>/dev/null` | |
echo "content = ${decrypt_content}" | |
echo "enc content = ${enc_content}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment