Giter Site home page Giter Site logo

kjellknapen / doctrine-encrypt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 51systems/doctrine-encrypt

0.0 1.0 0.0 61 KB

Package allows you to create Doctrine entities with fields that will be protected by encryption algorithms such as AES.

License: MIT License

PHP 100.00%

doctrine-encrypt's Introduction

DoctrineEncrypt Build Status

Package encrypts and decrypts Doctrine fields through life cycle events. This version of the Doctrine Encrypt package distinguishes itself with the following features:

  • Superior Annotation parsing & caching using Doctrine's built in libraries for superior performance
  • Totally transparent field encryption: the value will only be encrypted in the database, never in the value
  • Unit testing

Integrations

The package supports the following integrations:

  • Laravel

Upgrading

If you're upgrading from a previous version you can find some help with that in the upgrading guide.

Installation

composer require 51systems/doctrine-encrypt

Configuration

Laravel

Add the subscriber in the boot method of a service provider.

<?php

$encrypter = $this->app->make(\Illuminate\Contracts\Encryption\Encrypter::class);

$subscriber = new DoctrineEncryptSubscriber(
    new \Doctrine\Common\Annotations\AnnotationReader,
    new \DoctrineEncrypt\Encryptors\LaravelEncryptor($encrypter)
);

$eventManager = $em->getEventManager();
$eventManager->addEventSubscriber($subscriber);

Usage

<?php

namespace Your\Namespace;

use Doctrine\ORM\Mapping as ORM;

use DoctrineEncrypt\Configuration\Encrypted;

/**
 * @ORM\Entity
 */
class Entity
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\Column(type="integer")
     * @var int
     */
    private $id;

    /**
     * @ORM\Column(type="text")
     * @Encrypted
     * @var string
     */
    private $secretData;
}

License

This bundle is under the MIT license.

Versions

I'm using Semantic Versioning like described here.

doctrine-encrypt's People

Contributors

driesvints avatar kjellknapen avatar mkraemer avatar nepda avatar powturns avatar rjkip avatar vmelnik-ukraine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.