netkiller / safenet-php
此工具提供加密/解密字符串的有用功能。
dev-master
2015-09-02 05:31 UTC
Requires
- php: >=5.5.0
This package is not auto-updated.
Last update: 2024-09-28 18:05:21 UTC
README
PHP的SafeNet - http://www.safenet-inc.com/
安装
# yum install -y libcurl-devel
# git clone https://github.com/netkiller/safenet-php.git
# cd safenet-php
# /srv/php/bin/phpize
# ./configure --with-php-config=/srv/php/bin/php-config
# make
# make install
# cat > /srv/php/etc/conf.d/safenet.ini <<PHP
extension=safenet.so
[SafeNet]
safenet.url=http://175.145.40.55/safe/interface
safenet.key=Web01-key
safenet.timeout=10
PHP
测试
# /srv/php/bin/php -m | grep safenet
safenet
php -r "echo safenet_encrypt('helloworld');"
php -r "echo safenet_decrypt(safenet_encrypt('helloworld'));"
代码示例
<?php
echo safenet_encrypt('helloworld');
echo safenet_decrypt(safenet_encrypt('helloworld'));