PHP和Java 加解密

http://www.jb51.net/article/64961.htm

http://www.jb51.net/article/129218.htm

http://www.jb51.net/article/64961.htm

http://blog.csdn.net/yeshencat/article/details/72415624

http://blog.csdn.net/xionggang1024/article/details/76595402

http://www.runoob.com/php/func-string-hex2bin.html

http://www.w3school.com.cn/php/func_string_bin2hex.asp

 

逆推解密

$data1 = openssl_decrypt($data1, 'AES-128-ECB',$key2,OPENSSL_RAW_DATA);
$data1 = strrev($data1);
$data1 = openssl_decrypt($data1, 'AES-128-ECB',$key1,OPENSSL_RAW_DATA);

加密

$data1 = openssl_encrypt($data, 'AES-128-ECB',$key1,OPENSSL_RAW_DATA);
$data1 = strrev($data1);
$data1 = openssl_encrypt($data1, 'AES-128-ECB',$key2,OPENSSL_RAW_DATA);

 

hex2bin
把字符串转换为十六进制值:
$key = hex2bin($key)
bin2hex
把十六进制值转换为 ASCII 字符
$data = bin2hex($data); 

 

aes-128-gcm 加解密

PHP aes-128-gcm加密方式:https://blog.csdn.net/qq_39370482/article/details/113727328

PHP利用openssl整理AES加解密类: https://blog.csdn.net/u014231144/article/details/78774788

PHP实现AES加密解密: https://www.cnblogs.com/guliang/p/11763104.html

 

posted @ 2018-03-05 14:19  程序生(Codey)  阅读(516)  评论(0编辑  收藏  举报