Golang与PHP的AES加密解密互转
使用Github
上的mervick/aes-everywhere
加密库
mervick/aes-everywhere
还支持Python
、javascript
等其它语言
Golang的使用
go get github.com/mervick/aes-everywhere
import "github.com/mervick/aes-everywhere/go/aes256"
// encryption
encrypted := aes256.Encrypt("TEXT", "PASSWORD")
// decryption
decrypted := aes256.Decrypt(encrypted, "PASSWORD")
PHP的使用
composer require mervick/aes-everywhere
use mervick\aesEverywhere\AES256;
// encryption
$encrypted = AES256::encrypt("TEXT", "PASSWORD");
// decryption
$decrypted = AES256::decrypt($encrypted, "PASSWORD");
喜欢这篇文章的话 打赏一下吧!