PHPackages                             brandoriented/doctrine-encryption-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. brandoriented/doctrine-encryption-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

brandoriented/doctrine-encryption-bundle
========================================

Doctrine encryption bundle for Symfony to aid with GDPR and general field encryption

1.1.1(8y ago)019MITPHPPHP &gt;=7

Since May 23Pushed 8y agoCompare

[ Source](https://github.com/BrandOriented/doctrine-encryption-bundle)[ Packagist](https://packagist.org/packages/brandoriented/doctrine-encryption-bundle)[ Docs](https://github.com/BrandOriented/doctrine-encryption-bundle)[ RSS](/packages/brandoriented-doctrine-encryption-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Doctrine Encryption Bundle
==========================

[](#doctrine-encryption-bundle)

With GDPR becoming business critical here's a bundle that handles the data encryption layer.

Installation
------------

[](#installation)

`composer require brandoriented/doctrine-encryption-bundle dev-master`

```
   app/AppKernel.php

    public function registerBundles()
    {
        $bundles = [
            ...
            new BrandOriented\Encryption\DoctrineEncryptionBundle(),
            ...
        ];
    }
```

Configuration
-------------

[](#configuration)

***Basic***

Basic configuration will take advantage of the encryption library provided

```
doctrine_encryption:
  key: 'an encryption key'
  iv: 'an encryption iv'
  suffix: 'an encryption suffix'
```

***Full***

```
doctrine_encryption:
  key: 'an encryption key'
  iv: 'an encryption iv'
  suffix: 'an encryption suffix'
  method: 'AES-256-CBC' // This is the default setting
  class: 'Full\Namespace\To\Your\Encryptor' // If not supplied will use the default
```

Usage
-----

[](#usage)

### Using the encryption service in controller

[](#using-the-encryption-service-in-controller)

```
use BrandOriented\Encryption\Bridge\Bridge;

$this->get(Bridge::class)->encrypt($string)
$this->get(Bridge::class)->decrypt($string);
```

### Entity Annotation

[](#entity-annotation)

```
    use BrandOriented\Encryption\Annotation\Encrypted;

    class User {
       /**
       * @Encrypted()
       */
       private $firstname;

    }
```

The above will auto encrypt on `prePersist` and `preUpdate`

### Twig

[](#twig)

```
{{ user.firstname | decrypt }}
```

Design decision
---------------

[](#design-decision)

You'll notice there is no postLoad event to convert back to decrypted. Experience with doctrine is that as the entity is changed it adds it to the queue to be flushed. Say if you have an account with 1000 users each user would be decrypted meaning re saved.

How to add a custom Encryptor
-----------------------------

[](#how-to-add-a-custom-encryptor)

Create a class that extends `BrandOriented\Encryption\Encryptor\EncryptorInterface`. Then register as mentioned in the above config.

Tests
-----

[](#tests)

Yes there a loads of lovely unit tests :)

Roadmap
-------

[](#roadmap)

- Form inputs
- Command line util
- Travis integration

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 77.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2959d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46026201?v=4)[Effiana](/maintainers/Effiana)[@Effiana](https://github.com/Effiana)

---

Top Contributors

[![matt9mg](https://avatars.githubusercontent.com/u/8473296?v=4)](https://github.com/matt9mg "matt9mg (37 commits)")[![BrandOrientedTmp](https://avatars.githubusercontent.com/u/98951220?v=4)](https://github.com/BrandOrientedTmp "BrandOrientedTmp (11 commits)")

---

Tags

symfonybundleencryptionormdoctrinegdpr

### Embed Badge

![Health badge](/badges/brandoriented-doctrine-encryption-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/brandoriented-doctrine-encryption-bundle/health.svg)](https://phpackages.com/packages/brandoriented-doctrine-encryption-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

44918.0M166](/packages/sonata-project-doctrine-orm-admin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
