Re: AES_DECRYPT

Paul Coldrey <[email protected]> Thu, 24 Jun 2004 08:24:53 +0930
Newsgroups gmane.comp.db.mysql.bugs
Organization Ensigma
Message-ID <[email protected]>
Hi,

Works fine for me with the following test case:

CREATE TABLE Testing (
  Message VARCHAR(100)
);
 
INSERT INTO Testing VALUES(AES_ENCRYPT("hello", "spam"));
INSERT INTO Testing VALUES(AES_ENCRYPT("test", "spam"));
INSERT INTO Testing VALUES(AES_ENCRYPT("me", "spam"));

SELECT Message, AES_DECRYPT(Message, "spam") FROM Testing

Perhaps your PHP might be incorrect and is actually setting all but the 
first row to blank (which encrypted will look like a bona fide string)???

Anyhoo, if you want the MySQL guys to have a look at it you should 
supply them with your MySQL version and you should create a test case 
that exposes the bug using only SQL.

If you'd like me to look at your PHP then feel free to send it too me 
(you might want to do that directly rather than to the list or you might 
incur the wroth of the MySQL men :-))

Cheers,

    Paul.



Sapenov wrote:

>Hi all,
>
>I have problem with fetching records to php script.
>
>table structure :
>-----------------------
>id  int(10)
>message text
>----------------------
>
>i place information into message field using  following query 
>
>INSERT INTO table (message) VALUES (AES_ENCRYPT('$message','password'));
>
>it works fine, as i see in mysqlcc
>
>However, when I fire this query up both in php script and mysqlcc:
>
>SELECT AES_DECRYPT(message,'password'),message FROM CRM_tickets WHERE id='39' 
>
>it outputs following information:
>
>-------------------------------------------------------------------------------
>AES_DECRYPT(message,'password') |  message 
>-------------------------------------------------------------------------------
>decrypted text    |  encrypted text
>                        |  encrypted text
>                        |  encrypted text
>                        |  encrypted text
>                        |  encrypted text
>
>------------------------------------------------------------------------------- 
>
>*looks like function works off only once*
>
>
>Regards,
>
>Khazret Sapenov
>Software Developer
>CMS Inc
>Toronto, Canada
>  
>
>  
>



-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]