From a37f3a882227800c47095def809987637c28d083 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 2 Oct 2017 02:00:56 -0700 Subject: [PATCH] 2.0.0 - See CHANGELOG.md --- CHANGELOG.md | 9 +++++++++ README.md | 14 +++++++------- cryptr.bash | 13 +++++++------ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4df475..80906e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,11 @@ CHANGELOG ========= + +## 2.0.0 - *10/2/2017* + +*BREAKING CHANGE* +- Increased the OpenSSL key size to *256bit* from *128bit*. Any files encrypted with version `1.0.0` must be decrypted with version `1.0.0`. + +## 1.0.0 - *10/1/2017* + +- Initial release. diff --git a/README.md b/README.md index ffd4b6c..c79afee 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ ln -s "$PWD"/cryptr/cryptr.bash /usr/local/bin/cryptr ### encrypt -> encrypt \ - Encryptes file with OpenSSL AES-128 cipher block chaining. Writes an encrypted file out *(ciphertext)* appending `.aes` extension. +> encrypt \ - Encryptes file with OpenSSL AES-256 cipher block chaining. Writes an encrypted file out *(ciphertext)* appending `.aes` extension. ``` ➜ cryptr encrypt ./secrets-file -enter aes-128-cbc encryption password: -Verifying - enter aes-128-cbc encryption password: +enter aes-256-cbc encryption password: +Verifying - enter aes-256-cbc encryption password: ``` ``` @@ -30,7 +30,7 @@ Verifying - enter aes-128-cbc encryption password: ### decrypt -> decrypt \ - Decrypt encrypted file using OpenSSL AES-128 cipher block chaining. Writes a decrypted file out *(plaintext)* removing `.aes` extension. +> decrypt \ - Decrypt encrypted file using OpenSSL AES-256 cipher block chaining. Writes a decrypted file out *(plaintext)* removing `.aes` extension. ``` ➜ ls -alh @@ -39,7 +39,7 @@ Verifying - enter aes-128-cbc encryption password: ``` ➜ cryptr decrypt ./secrets-file.aes -enter aes-128-cbc decryption password: +enter aes-256-cbc decryption password: ``` ``` @@ -69,7 +69,7 @@ Usage: cryptr command ``` ➜ cryptr version -cryptr 1.0.0 +cryptr 2.0.0 ``` ### default @@ -78,7 +78,7 @@ cryptr 1.0.0 ``` ➜ cryptr -cryptr 1.0.0 +cryptr 2.0.0 Usage: cryptr command diff --git a/cryptr.bash b/cryptr.bash index 279cb81..ae9645f 100755 --- a/cryptr.bash +++ b/cryptr.bash @@ -18,7 +18,8 @@ set -eo pipefail; [[ $TRACE ]] && set -x -readonly VERSION="1.0.0" +readonly VERSION="2.0.0" +readonly OPENSSL_CIPHER="aes-256-cbc" cryptr_version() { echo "cryptr $VERSION" @@ -44,21 +45,21 @@ EOF cryptr_encrypt() { local _file="$1" if [[ ! -f "$_file" ]]; then - echo "File not found or invalid" 1>&2 + echo "File not found" 1>&2 exit 4 fi - openssl aes-128-cbc -salt -in "$_file" -out "$_file".aes + openssl $OPENSSL_CIPHER -salt -in "$_file" -out "$_file".aes } cryptr_decrypt() { local _file="$1" if [[ ! -f "$_file" ]]; then - echo "File not found or invalid" 1>&2 + echo "File not found" 1>&2 exit 5 fi - openssl aes-128-cbc -d -salt -in "$_file" -out "${_file%\.aes}" + openssl $OPENSSL_CIPHER -d -salt -in "$_file" -out "${_file%\.aes}" } cryptr_main() { @@ -89,7 +90,7 @@ cryptr_main() { ;; *) - cryptr_help >&2 + cryptr_help 1>&2 exit 3 esac }