Put these two functions into your ~/.bashrc
or ~/.zshrc
decrypt_secret() {
if [ "$#" -ne 2 ]; then
echo "Usage: decrypt_secret <secret.yaml> <passphrase>"
return 1
fi
openssl enc -aes-256-cbc -d -base64 -in "$1.aes256" -out "$1" -k "$2"
}
encrypt_secret() {
if [ "$#" -ne 2 ]; then
echo "Usage: encrypt_secret <secret.yaml> <passphrase>"
return 1
fi
openssl enc -aes-256-cbc -e -base64 -in "$1" -out "$1.aes256" -k "$2"
}