encryptionPHP
1.0.0
这是一个非常简单的PHP加密库。您可以使用此库使用 16、24、32 个字符的私钥加密或解密字符串。
$加密=新加密(字符串$ key);
// Include core encryption library from Src folder
require_once ' encryptionPHP .php ' ;
// Initialize encryption object
$ encryption = new Encryption ( ' bZKn8iklVOQr7eC8ONvnCeRFBJwWo1PG ' );加密字符串以确保其安全。
$加密->加密(字符串$text,字符串$iv);
// iv() funcation for dynamic encrypted data
$ iv = $ encryption -> iv ();
// Encrypt a string
$ encrypted = $ encryption -> encrypt ( ' Today is a good day! ' , $ iv );
echo $ encrypted ;解密加密的芯片。
字符串$加密->解密(字符串$chiper.字符串$iv);
$ decrypted = $ encryption -> decrypt ( $ encrypted , $ iv );
echo $ decrypted ;结果:
Today is a good day!
笔记:
Use this code to encrypt the data into database