Re: Encrypt and decrypt cookie
| From: | J Smith | Date: | Wed, 18 Dec 2002 18:27:45 +0000 |
| Subject: | Re: Encrypt and decrypt cookie | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128760@lists.php.net to get a copy of this message | ||
Note that IVs only affect block cipher modes other than ECB mode. ECB mode
ignores IVs completely.
J
Titu Kim wrote:
> 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