Encrypt and decrypt cookie
| From: | Titu Kim | Date: | Fri, 13 Dec 2002 17:38:59 +0000 |
| Subject: | Encrypt and decrypt cookie | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-128176@lists.php.net to get a copy of this message | ||
Hi,
I am using libmcrypt-2.5.3 to do encryption in php.
I use exactly the steps provided in mcrypt_module_open
available on php website
http://php.benscom.com/manual/en/function.mcrypt-module-open.php
I can encrypt and decrypt a string correctly. However,
if i encrypt a cookie to write to user's browser, the
decryption is incorrect when i try to decrypt this
cookie when user comes again. I found out the main
cause is the function mcrypt_module_open. This
function return a different resource everytime it is
called. Eventually it cause the decryption on cookie
to be incorrect. Can someone give me suggestion on how
to encrypt and decrypt a cookie?
Thanks very much.
Kim
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com