Download the PHP package gracious/doctrine-encryption-bundle without Composer
On this page you can find all versions of the php package gracious/doctrine-encryption-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gracious/doctrine-encryption-bundle
More information about gracious/doctrine-encryption-bundle
Files in gracious/doctrine-encryption-bundle
Package doctrine-encryption-bundle
Short Description Simple bundle for adding encryption type to Doctrine
License MIT
Informations about the package doctrine-encryption-bundle
Gracious Doctrine Encryption Bundle
Simple bundle to add 2 new types to Doctrine
- encrypted
- encryptedArrayCollection
- hashed
It relies on libSodium for encryption
Installation
The Installation is quite simple:
-
Require the Bundle via composer:
-
Add the following to your doctrine.yaml:
-
Generate a 64 character encryption key, you could to this the following way:
- Add the following two settings to your .env file:
Settings
There are 2 settings at the moment, both are env vars
-
ENABLE_ENCRYPTION - true / false
- ENCRYPTION_KEY - 64 character hexadecimal string
Generating a key
You can do 2 things to generate a key, either type one yourself or run:
Nonce
Nonces are automatically generated for each encrypted value and are added to the returned value as follows:
Doctrine settings
The following has to be added to you doctrine.yaml
The block would look something like this:
Usage
To use either of the 3 types in your entity just replace the column type with
or
or
All versions of doctrine-encryption-bundle with dependencies
ext-sodium Version *
ext-json Version *
doctrine/dbal Version ^4
doctrine/orm Version ^3
doctrine/doctrine-bundle Version *
doctrine/doctrine-migrations-bundle Version *
symfony/framework-bundle Version ^4.0|^5.0|^6.0|^7.0
symfony/flex Version ^1.0|^2.0