Skip to content

Commit b504b41

Browse files
authored
Update README.md
1 parent fba6f8b commit b504b41

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@ decrypting the content.
1212

1313
## Usage
1414

15-
In your DataObject, use EncryptedDBField, to have it encrypted. At this point, everything is stored as text.
16-
17-
Set a key in your `_ss_environment` file.
18-
19-
```define('ENCRYPT_AT_REST_KEY', 'mysupersecretlonghexkeyhere1234567890');```
20-
15+
In your DataObject, use the various field types in this module to have it encrypted. At this point, everything is stored as encrypted text.
2116

17+
Ensure you create a key to use for encryption/decryption. You can run the following code to generate a valid key:
18+
```php
19+
$key_object = Defuse\Crypto\Key::createNewRandomKey();
20+
$key_string = $key_object->saveToAsciiSafeString();
21+
```
2222

23+
This key can then be set in your `_ss_environment.php` file:
24+
25+
```
26+
define('ENCRYPT_AT_REST_KEY', 'defuse key here');
27+
```
2328

2429
## TODO
2530

@@ -28,4 +33,4 @@ Set a key in your `_ss_environment` file.
2833
- EncryptedEnum needs validation
2934
- Extended testing
3035
- Test if the value is actually encrypted, before trying to decrypt
31-
-
36+
- Merge in and release the SS4 upgrade

0 commit comments

Comments
 (0)