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

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

tox2ik/doctrine-encrypt-bundle
==============================

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

3.0.2(7y ago)023MITPHPPHP &gt;=5.6

Since Nov 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tox2ik/DoctrineEncryptBundle)[ Packagist](https://packagist.org/packages/tox2ik/doctrine-encrypt-bundle)[ RSS](/packages/tox2ik-doctrine-encrypt-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (22)Used By (0)

Fork
====

[](#fork)

- openssl
- propertyAccessor

---

\#DoctrineEncryptBundle

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. More about us can be found on our website. [Ambta.com](https://ambta.com)

\###What does it do exactly

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

```
/**
 * @Encrypt
 */
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

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

\####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

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/ambta/DoctrineEncryptBundle/blob/master/Resources/doc/installation.md)
- [Configuration](https://github.com/ambta/DoctrineEncryptBundle/blob/master/Resources/doc/configuration.md)
- [Usage](https://github.com/ambta/DoctrineEncryptBundle/blob/master/Resources/doc/usage.md)
- [Console commands](https://github.com/ambta/DoctrineEncryptBundle/blob/master/Resources/doc/commands.md)
- [Custom encryption class](https://github.com/ambta/DoctrineEncryptBundle/blob/master/Resources/doc/custom_encryptor.md)

\###License

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

\###Versions

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

\###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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community18

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 ~105 days

Recently: every ~138 days

Total

21

Last Release

2810d ago

Major Versions

1.0.0 → 2.0.02012-11-17

2.5.5 → v3.0.02017-04-21

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

2.4.1PHP &gt;=5.4

v3.0.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a4ffba7465505327c5421e1b710cda21c3d856f91d438cb457d519b6b018895?d=identicon)[tox2ik](/maintainers/tox2ik)

---

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)")[![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)")[![tox2ik](https://avatars.githubusercontent.com/u/890081?v=4)](https://github.com/tox2ik "tox2ik (3 commits)")[![maks-rafalko](https://avatars.githubusercontent.com/u/3725595?v=4)](https://github.com/maks-rafalko "maks-rafalko (2 commits)")[![mkraemer](https://avatars.githubusercontent.com/u/1070200?v=4)](https://github.com/mkraemer "mkraemer (2 commits)")[![Valegar](https://avatars.githubusercontent.com/u/658117?v=4)](https://github.com/Valegar "Valegar (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)")[![aburov-dev](https://avatars.githubusercontent.com/u/39696569?v=4)](https://github.com/aburov-dev "aburov-dev (1 commits)")[![westinpigott](https://avatars.githubusercontent.com/u/1909859?v=4)](https://github.com/westinpigott "westinpigott (1 commits)")[![BboyKeen](https://avatars.githubusercontent.com/u/1192309?v=4)](https://github.com/BboyKeen "BboyKeen (1 commits)")[![benr77](https://avatars.githubusercontent.com/u/2156742?v=4)](https://github.com/benr77 "benr77 (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)")[![PH-Lars](https://avatars.githubusercontent.com/u/10357876?v=4)](https://github.com/PH-Lars "PH-Lars (1 commits)")[![TNAJanssen](https://avatars.githubusercontent.com/u/2812277?v=4)](https://github.com/TNAJanssen "TNAJanssen (1 commits)")

---

Tags

symfonydoctrineencryptdecryptaes256

### Embed Badge

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

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

###  Alternatives

[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)[michaeldegroot/doctrine-encrypt-bundle

Encrypted symfony entity's by verified and standardized libraries

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

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

7277.3k1](/packages/vmelnik-doctrine-encrypt-bundle)

PHPackages © 2026

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