How do I encode something in PHP with a key?
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
精彩评论