开发者

How do I encode something in PHP with a key?

开发者 https://www.devze.com 2023-01-04 13:11 出处:网络
I see base64_encode can encode values, but without a key. I need a function that takes a salt and data, encodes it, and can be decoded with the same salt (but if you try to decode it without the salt,

I see base64_encode can encode values, but without a key. I need a function that takes a salt and data, encodes it, and can be decoded with the same salt (but if you try to decode it without the salt, it 开发者_StackOverflowgives you gibberish).

Is there a PHP function for this (can't find it, only modified versions of base64_encode).

EDIT: Found the answer: use mcrypt ciphers


What about taking a look at http://www.php.net/manual/en/book.mcrypt.php

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号