Skip to content

Commit d116a40

Browse files
committed
README and docblock updates for Str::encrypt() and Str::decrypt() methods
1 parent c9394dd commit d116a40

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,14 +893,19 @@ $string->bcrypt(['salt' => 'NaClNaClNaClNaClNaClNaCl']); // Returns '$2y$10$NaCl
893893
> Encrypt the string.
894894
895895
```php
896-
Twine\Str::encrypt( string $key, [ string $cipher = 'aes-128-gcm' ] ) : Twine\Str
896+
Twine\Str::encrypt( string $key, [ string $cipher = 'AES-128-CBC' ] ) : Twine\Str
897897
```
898898

899899
| Parameter | Description |
900900
| --------- | ---------------------- |
901901
| `$key` | The key for encrypting |
902902
| `$cipher` | The cipher method |
903903

904+
Supported cipher methods:
905+
906+
- `AES-128-CBC` (default)
907+
- `AES-256-CBC`
908+
904909
#### Example
905910

906911
```php
@@ -915,14 +920,19 @@ $string->encrypt('secret'); // Returns something like '$DZpEm9ZFec9ybxF7$y2rc62E
915920
> Decrypt the string.
916921
917922
```php
918-
Twine\Str::decrypt( string $key, [ string $cipher = 'aes-128-gcm' ] ) : Twine\Str
923+
Twine\Str::decrypt( string $key, [ string $cipher = 'AES-128-CBC' ] ) : Twine\Str
919924
```
920925

921926
| Parameter | Description |
922927
| --------- | ---------------------- |
923928
| `$key` | The key for decrypting |
924929
| `$cipher` | The cipher method |
925930

931+
Supported cipher methods:
932+
933+
- `AES-128-CBC` (default)
934+
- `AES-256-CBC`
935+
926936
#### Example
927937

928938
```php

src/Traits/Encryptable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ trait Encryptable
1919
* Encrypt the string.
2020
*
2121
* @param string $key The key for encrypting
22-
* @param string $cipher The cipher method (default: 'AES-128-CBC')
22+
* @param string $cipher The cipher method
2323
*
2424
* Supported cipher methods:
2525
*
26-
* - AES-128-CBC
26+
* - AES-128-CBC (default)
2727
* - AES-256-CBC
2828
*
2929
* @throws \PHLAK\Twine\Exceptions\EncryptionException
@@ -56,11 +56,11 @@ public function encrypt(string $key, string $cipher = 'AES-128-CBC') : self
5656
* Decrypt the string.
5757
*
5858
* @param string $key The key for decrypting
59-
* @param string $cipher The cipher method (default: 'AES-128-CBC')
59+
* @param string $cipher The cipher method
6060
*
6161
* Supported cipher methods:
6262
*
63-
* - AES-128-CBC
63+
* - AES-128-CBC (default)
6464
* - AES-256-CBC
6565
*
6666
* @throws \PHLAK\Twine\Exceptions\DecryptionException

0 commit comments

Comments
 (0)