michaeldegroot / doctrine-encrypt-bundle
Encrypted symfony entity's by verified and standardized libraries
Installs: 828 365
Dependents: 1
Suggesters: 0
Security: 0
Stars: 144
Watchers: 9
Forks: 227
Open Issues: 42
Requires
- php: ^8.0
- doctrine/orm: ^2.5
- paragonie/halite: ^4.6
- paragonie/sodium_compat: ^1.5
- symfony/config: ^4.1|^5.0|^6.0
- symfony/dependency-injection: ^4.1|^5.0|^6.0
- symfony/http-kernel: ^4.1|^5.0|^6.0
- symfony/property-access: ^4.1|^5.0|^6.0
- symfony/yaml: ^4.1|^5.0|^6.0
Requires (Dev)
- defuse/php-encryption: ^2.1
- phpunit/phpunit: ^8.0|^9.0
Suggests
- ext-sodium: Required to use halite encryption library.
- defuse/php-encryption: Alternative for halite for use with older php-versions
README
Introduction
This is a fork from the original bundle created by ambta which can be found here: ambta/DoctrineEncryptBundle
This bundle has updated security by not rolling it's own encryption and using verified standardized library's from the field.
Using Halite
All deps are already installed with this package
// Config.yml ambta_doctrine_encrypt: encryptor_class: Halite
Using Defuse
You will need to require Defuse yourself
composer require "defuse/php-encryption ^2.0"
// Config.yml ambta_doctrine_encrypt: encryptor_class: Defuse
Secret key
The secret key should be a max 32 byte hexadecimal string ([0-9a-fA-F]
).
Secret key is generated if there is no key found. This is automatically generated and stored in the folder defined in the configuration
// Config.yml ambta_doctrine_encrypt: secret_directory_path: '%kernel.project_dir%' # Default value
Filename example: .DefuseEncryptor.key
or .HaliteEncryptor.key
Do not forget to add these files to your .gitignore file, you do not want this on your repository!