Append extension during encryption

This commit is contained in:
Adam Daniels
2020-07-10 11:19:48 -04:00
parent 05ff65d6e3
commit 3421864c38
2 changed files with 6 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
CHANGELOG
=========
## Unreleased
- Append `.aes` file extension instead of substituting when encrypting
## 2.1.1 - *3/25/2019*
- Updated the notice text when using environment variable `CRYPTR_PASSWORD` for the password.

View File

@@ -46,9 +46,9 @@ cryptr_encrypt() {
if [[ ! -z "${CRYPTR_PASSWORD}" ]]; then
echo "[notice] using environment variable CRYPTR_PASSWORD for the password"
openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "${_file%\.aes}" -pass env:CRYPTR_PASSWORD
openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "${_file}.aes" -pass env:CRYPTR_PASSWORD
else
openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "${_file%\.aes}"
openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "${_file}.aes"
fi
}