Page 1 of 1

Asymmetrical encryption using PHP...

Posted: Tue Apr 08, 2008 9:19 am
by bovermyer
Hi there.

I need to encrypt very sensitive data using an asymmetrical (public key) security scheme. The data must be encrypted via public key and stored in a MySQL database. It must then be able to be retrieved by a user who manually enters the private key in a dialog box (Javascript).

I've done a lot of Googling but can't seem to find how to do this exactly. I need to work with PHP 4.4.1, as that is what's on our server. I've seen a lot of references to PGP/GnuPG with regards to public key encryption, but all of it seems to center around email.

Anyone have any ideas?

Re: Asymmetrical encryption using PHP...

Posted: Mon Apr 14, 2008 7:48 am
by bovermyer
Is there really no one who knows anything about public key encryption here?

Re: Asymmetrical encryption using PHP...

Posted: Mon Apr 14, 2008 8:23 am
by onion2k
MySQL can do AES encryption without any extensions. That might help. Look at aes_encrypt() and aes_decrypt() in the MySQL manual.

Re: Asymmetrical encryption using PHP...

Posted: Mon Apr 14, 2008 9:05 am
by Mordred
onion2k wrote:MySQL can do AES encryption without any extensions. That might help. Look at aes_encrypt() and aes_decrypt() in the MySQL manual.
Hmm, this would mean that the client has to send his private key over to the web server, who willl send it to the database server.

bovermyer, you would need a javascript implementation for both encryption and decryption. What is this "sensitive" data that you can't do anything else?