testinaweb / dynamic-crypto
一个使用动态密钥加密和解密字符串的 PHP 库
1.0.4
2015-03-23 20:17 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- behat/behat: 3.0.*@dev
- phpunit/phpunit: 4.5.*@dev
This package is not auto-updated.
Last update: 2024-09-28 18:23:29 UTC
README
A php library to encrypt and decrypt strings with dynamic keys. This was be implemented to guarantee a quite high security level.
动态密钥基于密码短语散列的子串。密钥的第一个字符的位置被保存在加密字符串的末尾以恢复加密过程。由于随机的子串,每个加密字符串都将与前一个不同。
安装
在您的项目中使用 Dynamic Crypto 之前,将其添加到 "composer.json" 文件中
{
"require": {
"testinaweb/dynamic-crypto": "1.0.*@dev"
}
}
或者运行以下 bash 命令
./composer.phar require testinaweb/dynamic-crypto 1.0.*@dev
用法
<?php use DynamicCrypto\DynamicCryptoFactory; $passPhrase = 'ILoveDC'; $input = 'Your string here'; $dynamicEncrypt = DynamicCryptoFactory::buildDynamicEncrypter($passPhrase); $dynamicDecrypt = DynamicCryptoFactory::buildDynamicDecrypter($passPhrase); $encryptedString = $dynamicEncrypt->encrypt($input); $decryptedString = $dynamicDecrypt->decrypt($encryptedString);
作者
Manuel Kanah - testinaweb@testinaweb.com - http://www.labna.it
特别感谢 Gabriele Giuranno - https://github.com/giordan83
许可
Dynamic Crypto 在 MIT 许可下授权