Skip to content

Commit

Permalink
2.0.0 - See CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nodesocket committed Oct 2, 2017
1 parent e55e624 commit a37f3a8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```

```
Expand All @@ -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
Expand All @@ -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:
```

```
Expand Down Expand Up @@ -69,7 +69,7 @@ Usage: cryptr command <command-specific-options>
```
➜ cryptr version
cryptr 1.0.0
cryptr 2.0.0
```

### default
Expand All @@ -78,7 +78,7 @@ cryptr 1.0.0
```
➜ cryptr
cryptr 1.0.0
cryptr 2.0.0
Usage: cryptr command <command-specific-options>
Expand Down
13 changes: 7 additions & 6 deletions cryptr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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() {
Expand Down Expand Up @@ -89,7 +90,7 @@ cryptr_main() {
;;

*)
cryptr_help >&2
cryptr_help 1>&2
exit 3
esac
}
Expand Down

0 comments on commit a37f3a8

Please sign in to comment.