Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

官网有警告说:This function has been DEPRECATED as of PHP 7.1.0. Relying on this function is highly discouraged.

那么加密解密用什么函数呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
283 views
Welcome To Ask or Share your Answers For Others

1 Answer

openssl_encrypt
openssl_decrypt

>>> openssl_encrypt("1", "aes-256-cbc", "12312321", 0, "1234123443212345");
=> "x6Zfu2cbtbMDfkt2s/GE2A=="
>>> openssl_decrypt("x6Zfu2cbtbMDfkt2s/GE2A==", "aes-256-cbc", "12312321", 0, "1234123443212345");
=> "1"

另可参阅 How do you Encrypt and Decrypt a PHP String?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...