Jump to content

Problem storing/retrieving AES encrypted data in MySQL?!?!?


Laxidasical

Recommended Posts

I have a script that encrypts data via mcrypt/AES.  For some reason I can't seem to store & retrieve that data correctly in MySQL.  When I try to retrieve the information and decrypt it I get garbage.

 

I changed my script to base64_encode() the encrypted data, store it in the database, then base64_decode() it before decrypting it, which works great.  Everything I've read though says that I should be able to store it in MySQL directly with no problems as long as I'm using a binary datatype (such as BLOB).

 

Any suggestions???  :confused:

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.