kittinan/crypt-time-php
Composer 安装命令:
composer require kittinan/crypt-time-php
包简介
CryptTime-PHP is a simple class to encrypt string with timeout. the encryption use AES128/PKCS7.
README 文档
README
CryptTime-PHP is a simple class to encrypt string with timeout. the encryption use AES128/PKCS7.
Requirement
- PHP 5.3+
- php-mcrypt
Composer
This plugin on the Packagist.
https://packagist.org/packages/kittinan/crypt-time-php
Quick Start.
$plainText = 'Hello World'; $cryptTime = \KS\CryptTime::getInstance(); $cipherText = $cryptTime->encrypt($plainText); //Default timeout is 86400 seconds (1 day) $decryptText = $cryptTime->decrypt($cipherText);
if you want to encrypt string with 10 minutes timeout.
$plainText = 'Hello World'; $cryptTime = \KS\CryptTime::getInstance(); $cipherText = $cryptTime->encrypt($plainText, 600); //10 minutes = 600 seconds $decryptText = $cryptTime->decrypt($cipherText);
you can set IV and Key
$cryptTime = \KS\CryptTime::getInstance(); $cryptTime->setIV('MyNewInitialValue'); $cryptTime->setKey('MyNewKeyMyNewKeyMyNewKey');
License
The MIT License (MIT)
统计信息
- 总下载量: 79
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-09-10