2.0.0 - See CHANGELOG.md

This commit is contained in:
Justin
2017-10-02 02:00:56 -07:00
parent e55e62413a
commit a37f3a8822
3 changed files with 23 additions and 13 deletions

View File

@@ -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.

View File

@@ -13,12 +13,12 @@ ln -s "$PWD"/cryptr/cryptr.bash /usr/local/bin/cryptr
### encrypt
> encrypt \<file\> - Encryptes file with OpenSSL AES-128 cipher block chaining. Writes an encrypted file out *(ciphertext)* appending `.aes` extension.
> encrypt \<file\> - 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 \<file.aes\> - Decrypt encrypted file using OpenSSL AES-128 cipher block chaining. Writes a decrypted file out *(plaintext)* removing `.aes` extension.
> decrypt \<file.aes\> - 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 <command-specific-options>
```
➜ 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 <command-specific-options>

View File

@@ -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
}