jackprice/doctrine-encrypt
Composer 安装命令:
composer require jackprice/doctrine-encrypt
包简介
A package for the safe encryption of Doctrine fields
README 文档
README
A package for the safe encryption and decryption of Doctrine fields.
Usage
Register the custom encrypted Doctrine type somewhere in the initialisation of your application.
<?php \Doctrine\DBAL\Types\Type::addType( \DoctrineEncrypt\Types\Encrypted::ENCRYPTED, \DoctrineEncrypt\Types\Encrypted::class );
Set the encryption key.
Important: You are responsible for securing and generating a strong key.
<?php $encryptor = new \DoctrineEncrypt\Encryptors\AES256Encryptor(sha1('Use a very strong key here')); \DoctrineEncrypt\Types\Encrypted::setEncryptor($encryptor);
Use the encrypted type in your entities.
<?php class MyEntity { /** * @ORM\Column(type="encrypted") */ protected $encrypted; }
TODO
- Add more documentation
- Handle unencrypted fields
- Create a CLI to encrypt fields
- Allow key rotation
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-13