From d116a4068d0bbb74012e0c602495f899f11db4a4 Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Mon, 16 Jul 2018 19:35:01 -0700 Subject: [PATCH] README and docblock updates for Str::encrypt() and Str::decrypt() methods --- README.md | 14 ++++++++++++-- src/Traits/Encryptable.php | 8 ++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7b8ea81..ae71d3c 100644 --- a/README.md +++ b/README.md @@ -893,7 +893,7 @@ $string->bcrypt(['salt' => 'NaClNaClNaClNaClNaClNaCl']); // Returns '$2y$10$NaCl > Encrypt the string. ```php -Twine\Str::encrypt( string $key, [ string $cipher = 'aes-128-gcm' ] ) : Twine\Str +Twine\Str::encrypt( string $key, [ string $cipher = 'AES-128-CBC' ] ) : Twine\Str ``` | Parameter | Description | @@ -901,6 +901,11 @@ Twine\Str::encrypt( string $key, [ string $cipher = 'aes-128-gcm' ] ) : Twine\St | `$key` | The key for encrypting | | `$cipher` | The cipher method | +Supported cipher methods: + + - `AES-128-CBC` (default) + - `AES-256-CBC` + #### Example ```php @@ -915,7 +920,7 @@ $string->encrypt('secret'); // Returns something like '$DZpEm9ZFec9ybxF7$y2rc62E > Decrypt the string. ```php -Twine\Str::decrypt( string $key, [ string $cipher = 'aes-128-gcm' ] ) : Twine\Str +Twine\Str::decrypt( string $key, [ string $cipher = 'AES-128-CBC' ] ) : Twine\Str ``` | Parameter | Description | @@ -923,6 +928,11 @@ Twine\Str::decrypt( string $key, [ string $cipher = 'aes-128-gcm' ] ) : Twine\St | `$key` | The key for decrypting | | `$cipher` | The cipher method | +Supported cipher methods: + + - `AES-128-CBC` (default) + - `AES-256-CBC` + #### Example ```php diff --git a/src/Traits/Encryptable.php b/src/Traits/Encryptable.php index 138f2c0..4043341 100644 --- a/src/Traits/Encryptable.php +++ b/src/Traits/Encryptable.php @@ -19,11 +19,11 @@ trait Encryptable * Encrypt the string. * * @param string $key The key for encrypting - * @param string $cipher The cipher method (default: 'AES-128-CBC') + * @param string $cipher The cipher method * * Supported cipher methods: * - * - AES-128-CBC + * - AES-128-CBC (default) * - AES-256-CBC * * @throws \PHLAK\Twine\Exceptions\EncryptionException @@ -56,11 +56,11 @@ public function encrypt(string $key, string $cipher = 'AES-128-CBC') : self * Decrypt the string. * * @param string $key The key for decrypting - * @param string $cipher The cipher method (default: 'AES-128-CBC') + * @param string $cipher The cipher method * * Supported cipher methods: * - * - AES-128-CBC + * - AES-128-CBC (default) * - AES-256-CBC * * @throws \PHLAK\Twine\Exceptions\DecryptionException