I need to encrypt some form POST data.
My initial idea was to use mcrypt, using MCRYPT_RIJNDAEL_256 and MCRYPT_MODE_CBC, but this failed because the encrypted string contained single and double quote characters which caused problems with the delimiter of the value part of the hidden form field.
<input type='hidden' name='pid' value='<?php echo $text; ?>'/>
I've added a line to my encrypt function to base64_encode the encrypted string, which I think precludes single and double quotes from the resultant string, but I'm not certain about this. Its worked fine with all the large chunks of text I've tested it with so far.
This seems a very roundabout way of doing things, is there an alternative cypher mode or cypher which offers security and is designed with POST data in mind, i.e. excludes quotes within the string. I can't use hashing as I want to decrypt the form data later.
Blu