PHPackages                             integralservice/doctrine-encrypt-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. integralservice/doctrine-encrypt-bundle

ActiveLibrary[Database &amp; ORM](/categories/database)

integralservice/doctrine-encrypt-bundle
=======================================

Symfony 2 bundle which allows to encrypt data in database with some encrypt algorithm

v3.0.0(7y ago)2151[1 issues](https://github.com/IntegralService/DoctrineEncryptBundle/issues)MITPHPPHP &gt;=7.2

Since Nov 14Pushed 7y ago2 watchersCompare

[ Source](https://github.com/IntegralService/DoctrineEncryptBundle)[ Packagist](https://packagist.org/packages/integralservice/doctrine-encrypt-bundle)[ RSS](/packages/integralservice-doctrine-encrypt-bundle/feed)WikiDiscussions master Synced 5d ago

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

DoctrineEncryptBundle
=====================

[](#doctrineencryptbundle)

[![Build Status](https://camo.githubusercontent.com/e523a51c20dfb07497a5f18da04af9ff883628238fdc0fe1c45297cb12feb8a3/68747470733a2f2f7472617669732d63692e636f6d2f496e74656772616c536572766963652f446f637472696e65456e637279707442756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/IntegralService/DoctrineEncryptBundle)[![Latest Stable Version](https://camo.githubusercontent.com/0622ca22787f83ffc362ae41a80bda811f861f9d62e79e183e0a17cc206f72a7/68747470733a2f2f706f7365722e707567782e6f72672f696e74656772616c736572766963652f646f637472696e652d656e63727970742d62756e646c652f762f737461626c65)](https://packagist.org/packages/integralservice/doctrine-encrypt-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/bf60d1f3064f32e8389110cdad2b427b8c9805ee8915c1dbee58d519bf5a31c8/68747470733a2f2f706f7365722e707567782e6f72672f696e74656772616c736572766963652f646f637472696e652d656e63727970742d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/integralservice/doctrine-encrypt-bundle)[![PHP from Packagist](https://camo.githubusercontent.com/ff7c757dd5b9b47e297e09ac3f67177d585074a32bf555061c0667bf0dafa59d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f696e74656772616c736572766963652f646f637472696e652d656e63727970742d62756e646c652e737667)](https://camo.githubusercontent.com/ff7c757dd5b9b47e297e09ac3f67177d585074a32bf555061c0667bf0dafa59d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f696e74656772616c736572766963652f646f637472696e652d656e63727970742d62756e646c652e737667)[![License](https://camo.githubusercontent.com/6e4e85d2c256e1c2dd7bc8246573517710a971ce913aadf0258d4560466cfecc/68747470733a2f2f706f7365722e707567782e6f72672f696e74656772616c736572766963652f646f637472696e652d656e63727970742d62756e646c652f6c6963656e7365)](https://packagist.org/packages/integralservice/doctrine-encrypt-bundle)

Bundle allows to create doctrine entities with fields that will be protected with help of some encryption algorithm in database and it will be clearly for developer, because bundle is uses doctrine life cycle events

This is an fork from the original bundle created by vmelnik-ukrain (Many thanks to him) which can be found here: [vmelnik-ukraine/DoctrineEncryptBundle](https://github.com/vmelnik-ukraine/DoctrineEncryptBundle)

I improved several things, i make better use of the doctrine events. and it works with lazy loading (relationships)! This will be an long term project we will be working on with long-term support and backward compatibility. We are using this bundle in all our own symfony2 project.

What does it do exactly
-----------------------

[](#what-does-it-do-exactly)

It gives you the opportunity to add the @Encrypted annotation above each string property

```
/**
 * @Encrypted
 */
protected $username;
```

The bundle uses doctrine his life cycle events to encrypt the data when inserted into the database and decrypt the data when loaded into your entity manager. It is only able to encrypt string values at the moment, numbers and other fields will be added later on in development.

Advantages and disadvantaged of an encrypted database
-----------------------------------------------------

[](#advantages-and-disadvantaged-of-an-encrypted-database)

### Advantages

[](#advantages)

- Information is stored safely
- Not worrying about saving backups at other locations
- Unreadable for employees managing the database

### Disadvantages

[](#disadvantages)

- Can't use ORDER BY on encrypted data
- In SELECT WHERE statements the where values also have to be encrypted
- When you lose your key you lose your data (Make a backup of the key on a safe location)

Documentation
-------------

[](#documentation)

This bundle is responsible for encryption/decryption of the data in your database. All encryption/decryption work on the server side.

The following documents are available:

- [Installation](https://github.com/integralservice/DoctrineEncryptBundle/blob/master/Resources/doc/installation.md)
- [Configuration](https://github.com/integralservice/DoctrineEncryptBundle/blob/master/Resources/doc/configuration.md)
- [Usage](https://github.com/integralservice/DoctrineEncryptBundle/blob/master/Resources/doc/usage.md)
- [Console commands](https://github.com/integralservice/DoctrineEncryptBundle/blob/master/Resources/doc/commands.md)
- [Custom encryption class](https://github.com/integralservice/DoctrineEncryptBundle/blob/master/Resources/doc/custom_encryptor.md)

License
-------

[](#license)

This bundle is under the MIT license. See the complete license in the bundle

Versions
--------

[](#versions)

I'm using Semantic Versioning like described [here](http://semver.org)

Todos
-----

[](#todos)

The following items will be done in order

1. Review of complete code + fixes/improvements and inline documentation (2.1.1)
2. Add support for the other doctrine relationships (manyToMany, ManyToOne) (2.2)
3. Recreate documentation (2.3)
4. Create example code (2.3)
5. Create an function to encrypt unencrypted database and vice versa (console command, migration, changed key, etc.) (2.4)
6. Look for a posibility of automatic encryption of query parameters (2.5)
7. Look for a posibility to override findOneBy for automatic encryption of parameters (2.6)
8. Add support to encrypt data by reference to other property as key (Encrypt data specific to user with user key etc.) (2.7)
9. Add [Format-preserving encryption](http://en.wikipedia.org/wiki/Format-preserving_encryption) for all data types [Doctrine documentation Types](http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html) (3.0)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~126 days

Recently: every ~241 days

Total

18

Last Release

2784d ago

Major Versions

1.0.0 → 2.0.02012-11-17

2.5.4 → v3.0.02018-10-01

PHP version history (3 changes)1.0.0PHP &gt;=5.3.2

2.4.1PHP &gt;=5.4

v3.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/92841588ce1be37e4ba94201b77f65876cbfed701e6aabde96031b95303ceac8?d=identicon)[jurv](/maintainers/jurv)

---

Top Contributors

[![dev-marcel](https://avatars.githubusercontent.com/u/11071510?v=4)](https://github.com/dev-marcel "dev-marcel (33 commits)")[![vmelnik-ukraine](https://avatars.githubusercontent.com/u/1994051?v=4)](https://github.com/vmelnik-ukraine "vmelnik-ukraine (23 commits)")[![jurv](https://avatars.githubusercontent.com/u/1393926?v=4)](https://github.com/jurv "jurv (6 commits)")[![michaelfeinbier](https://avatars.githubusercontent.com/u/503543?v=4)](https://github.com/michaelfeinbier "michaelfeinbier (6 commits)")[![ambta](https://avatars.githubusercontent.com/u/10357868?v=4)](https://github.com/ambta "ambta (4 commits)")[![smashou](https://avatars.githubusercontent.com/u/1225663?v=4)](https://github.com/smashou "smashou (4 commits)")[![mkraemer](https://avatars.githubusercontent.com/u/1070200?v=4)](https://github.com/mkraemer "mkraemer (2 commits)")[![maks-rafalko](https://avatars.githubusercontent.com/u/3725595?v=4)](https://github.com/maks-rafalko "maks-rafalko (2 commits)")[![PH-Lars](https://avatars.githubusercontent.com/u/10357876?v=4)](https://github.com/PH-Lars "PH-Lars (1 commits)")[![westinpigott](https://avatars.githubusercontent.com/u/1909859?v=4)](https://github.com/westinpigott "westinpigott (1 commits)")[![Valegar](https://avatars.githubusercontent.com/u/658117?v=4)](https://github.com/Valegar "Valegar (1 commits)")[![BboyKeen](https://avatars.githubusercontent.com/u/1192309?v=4)](https://github.com/BboyKeen "BboyKeen (1 commits)")[![wassafr](https://avatars.githubusercontent.com/u/10235180?v=4)](https://github.com/wassafr "wassafr (1 commits)")[![wcoppens](https://avatars.githubusercontent.com/u/181460?v=4)](https://github.com/wcoppens "wcoppens (1 commits)")[![jongotlin](https://avatars.githubusercontent.com/u/165154?v=4)](https://github.com/jongotlin "jongotlin (1 commits)")[![jr-k](https://avatars.githubusercontent.com/u/3283866?v=4)](https://github.com/jr-k "jr-k (1 commits)")[![benr77](https://avatars.githubusercontent.com/u/2156742?v=4)](https://github.com/benr77 "benr77 (1 commits)")

---

Tags

doctrineencryptionphp72symfony-bundlesymfony3symfonydoctrineencryptdecrypt

### Embed Badge

![Health badge](/badges/integralservice-doctrine-encrypt-bundle/health.svg)

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

###  Alternatives

[michaeldegroot/doctrine-encrypt-bundle

Encrypted symfony entity's by verified and standardized libraries

1521.0M1](/packages/michaeldegroot-doctrine-encrypt-bundle)[ambta/doctrine-encrypt-bundle

Symfony 2 bundle which allows to encrypt data in database with some encrypt algorithm

77275.7k](/packages/ambta-doctrine-encrypt-bundle)[doctrineencryptbundle/doctrine-encrypt-bundle

Encrypted symfony entity's by verified and standardized libraries

29415.1k](/packages/doctrineencryptbundle-doctrine-encrypt-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.

1022.4k](/packages/rcsofttech-audit-trail-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

813.1k](/packages/ahmed-bhs-doctrine-doctor)

PHPackages © 2026

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