insitaction / field-encrypt-bundle
Allows automatic encryption of fields, as required by GDPR.
Installs: 5 178
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 0
Type:symfony-bundle
Requires
- php: >=8.2
- ext-openssl: *
- doctrine/orm: ^2.16
- symfony/framework-bundle: ^6.0|^7.0
- symfony/html-sanitizer: ^6.0|^7.0
- symfony/polyfill-php80: ^1.28
- symfony/property-access: ^6.0|^7.0
This package is auto-updated.
Last update: 2024-12-04 15:00:03 UTC
README
Field Encrypt
Field Encrypt is a symfony bundle which allows to encrypt the fields in the database as required by the GDPR.
Installation:
composer require insitaction/field-encrypt-bundle
Environment:
You must define the ENCRYPT_KEY var in your .env file.
The ENCRYPT_KEY must be an aes-256-cbc key with the 32 first characters.
Usage:
You must add the EncryptedString::ENCRYPTED_STRING type attribute to the field you want to encrypt/decrypt.
Let's see an example:
<?php namespace App\Entity; use Doctrine\ORM\Mapping as ORM; use Insitaction\FieldEncryptBundle\Doctrine\DBAL\Types\EncryptedString; class MyEntity { #[ORM\Column(type: EncryptedString::ENCRYPTED_STRING, unique: true)] private mixed $myPrivateEncryptedField; #[ORM\Column(type: 'string', unique: true)] private string $email; public function getUniqueIdentifier(): string { return $this->email; } }
That's else !