You could try the smime function.
http://www.openssl.org/docs/apps/smime.html

I use the smime function to encrypt and decrypt credit card numbers and to
send me encrypted receipts of transactions. However, you could just as
easily use it to encrypt and decrypt cookies - if that's what you want to
do.

As cookies are only valid within the one domain, I can't see a point in
encryting them to your servers "public key" and decrypting them with your
servers "private key" and password.

When I want to securely maintain state between forms, I create a psudeo
random string, I write a temporary file and name it with that psudeo random
string, I encrypt the string using a symetric algorithm and create a cookie
using the encrypted string. On the next page I retrieve the cookie from the
client, decrypt it, and then I can retrieve and open the temp file I
created, containing the info I'm after. At the end of the process the file
is deleted.

Is there a better/more efficient way to maintain state securely?


> Hi
>
> I'm trying to write up a module which will encrypt cookie data with the
> server's private key. And another module which will decrypt this cookie
> data using the server's public key.
>
> Could you please provide hints and/or resources which might help with
> this.
>
> Thanks
>
> Mevlana Sari
>
> [EMAIL PROTECTED]
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to