MySQL Forums
Forum List  »  PHP

Trouble with AES_DECRYPTéENCRYPT
Posted by: jj jj
Date: June 16, 2005 09:54AM

I'm trying to get the data from a table that was previously encrypted using AES_ENCRYPT. I can get the data just fine except when I try to perform a: where ___ like '%...%' Here is what I have:

Note: assume $name = 'Nick'; (local variable)

$statm = "select ".$columns." from test where name like AES_ENCRYPT('%".$name."%',@key);

It returns nothing. Infact it fails! I'm not sure how to turn this:

$statm = "select ".$columns." from test where name like '%".$name."%'";

into an encrypted form. I tried setting up a mysql user variable that contains the encrypted value and then inserting it into the select statement. It also failed.

$enc_name = $logo->queryDB("Set @encname:=AES_ENCRYPT('".$name."',@key)");

$statm = "select ".$columns." from test where name like '%@encname%'";

Any ideas would be appreciated!!!

Nick

Options: ReplyQuote


Subject
Written By
Posted
Trouble with AES_DECRYPTéENCRYPT
June 16, 2005 09:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.