primus852 / simple-crypt
简单字符串加密
1.2.0
2018-09-21 11:58 UTC
Requires
- php: ^7.0
- ext-openssl: *
- defuse/php-encryption: ^2.1
This package is auto-updated.
Last update: 2024-09-20 01:53:14 UTC
README
非常简单的方式来加密字符串(不要用于加密敏感数据)
用法
$sc = new SimpleCrypt('my-salt', 'iv');
加密
$encrypted = $sc->encrypt('TEST');
解密
$decrypted = $sc->decrypt($encrypted);
静态
$enc = SimpleCrypt::enc('TEST');
$dec = SimpleCrypt::dec($enc);
加密算法 ( https://github.com/defuse/php-encryption)
$enc = SimpleCrypt::encCipher('TEST','MyLongASCIIKey');
$dec = SimpleCrypt::decCipher($enc,'MyLongASCIIKey);