I am not a specialist, but I discovered the parameter iv and the
related function create_iv. Most likely you must provide an created iv
before encryption, store the cypher and the iv together in the cookie and at
retreaval, use both in decrypt.
So in between:
/* Terminate encryption handler */
mcrypt_generic_deinit ($td);
/* Initialize encryption module for decryption */
mcrypt_generic_init ($td, $key, $iv);
you store and retreave from the cookie both $iv and $td. $key must be on
your server. $iv must be some
random stuff that changes between encryption and decryption (between
sessions). Play with it and you will find out.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php