pshken/phpseclib-bundle
Composer 安装命令:
composer require pshken/phpseclib-bundle
包简介
PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc. Created By Jim Wigginton and Modified to be a Symfony2 Bundle.
README 文档
README
PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc. Created By Jim Wigginton and Modified to be a Symfony2 Bundle.
MIT-licensed pure-PHP implementations of an arbitrary-precision integer arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael, AES, SSH-1, SSH-2, SFTP, and X.509
Step 1: Download phpseclib-bundle using composer
Add FOSUserBundle in your composer.json:
{ "require": { ... "sinner/phpseclib-bundle": "dev-master" ... } }
Now tell composer to download the bundle by running the command:
$ php composer.phar update sinner/phpseclib-bundle
or
$ composer update sinner/phpseclib-bundle
Composer will install the bundle to your project's vendor/sinner directory.
Step 2: Activate PHPSecLibBundle in you Symfony2 Project
Edit the appKernel.php file in the $bundles array area:
//"app/appKernel.php" ... $bundles = array( ... new Sinner\Phpseclib\PhpseclibBundle(); ... ); ...
Step 3: Encrypt, Decrypt and Enjoy
Suppose that you have a User Entity...
/** * Entity/Usuario.php * */ class Usuario { public $id; public $nombre; public $apellido; public $email; public $twitter; }
... and you want to save the User data on Encrypted Way (For example in a Session) from your Controller
/** * Controller/DefaultController.php * */ use Sinner\Phpseclib\Crypt\Crypt_TripleDES as TripleDES; Class DefaultController extends Controller{ public fucntion indexAction(){ //... $usuario_obj = new Usuario(); $usuario_obj->id = 1; $usuario_obj->nombre = 'José Gabriel'; $usuario_obj->apellido = 'González Pérez'; $usuario_obj->email = 'jgabrielsinner10@gmail.com'; $usuario_obj->twitter = '@JGabrielTupac'; const KEY_ENCRYPT = '548c286a61462d896573567b7a30335d4959427e5c7a675e325b6c7a7c'; $_KEY_ENCRYPT = KEY_ENCRYPT; $encrypter = new TripleDES(); $encrypter->setKey($_KEY_ENCRYPT); $usuario_obj_encrypt = $encrypter->encrypt(serialize($usuario_obj)); $usuario = unserialize($encrypter->decrypt($usuario_obj_encrypt)); var_dump($usuario_obj_encrypt); var_dump($usuario); //... } }
pshken/phpseclib-bundle 适用场景与选型建议
pshken/phpseclib-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.03k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 05 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Symfony2」 「cryptography」 「crypt」 「phpseclib」 「Jim Wigginton」 「Sinner」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pshken/phpseclib-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pshken/phpseclib-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pshken/phpseclib-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
DUKPT implementation in PHP
Composer friendly version of http://web.archive.org/web/20130727034425/http://blog.kevburnsjr.com/php-unique-hash
Strong cryptography tools and password hashing
This symfony user provider reads user from the htpasswd file.
Portable PHP password hashing framework
A pure PHP implementation of an MD5-hashsum-based implementation of the crypt routine, which can be used to generate hashs for Apache's passwd files
统计信息
- 总下载量: 1.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-26