Doctrine2 behavioral extensions which allows to transform (encrypt, decrypt, hash) your data automatically
These extensions add more functionality to Doctrine2.
This extension uses transform and reverseTransform methods to convert data to and from the database. This can for example be used to encrypt a field when it's sent to the database and it will be decrypted when it is retrieved from the database.
The field's value will only be transformed when the value changed which also makes it possible to implement only a transform function for one way transformations like hashing.
Currently these adapters are provided in order of recommendation:
- HaliteSymmetricTransformer - Encrypt/decrypts the value
- DefuseCryptoEncryptKeyTransformer - Encrypt/decrypts the value
- PhpHashTransformer - Hashes the value
- PhpHmacTransformer - Hashes the value with a key
- ZendCryptHashTransformer - Hashes the value
- ZendCryptHmacTransformer - Hashes the value with a key
- ZendCryptSymmetricTransformer - Encrypts/decrypts the value
You can easily create your own transformers by implementing the TransformableInterface
- PHP >= 5.6 or >= 7.0
To use the library.
Install this package by using Composer.
$ composer require mediamonks/doctrine-extensions
If you discover any security related issues, please email email@example.com instead of using the issue tracker.
Please refer to the files in the /doc folder.
This package was inspired by/uses code from gedmo/doctrine-extensions.
The MIT License (MIT). Please see License File for more information.