I'm trying to setup a (relatively) simple encryption/decryption for a database I'm using. When I stepped into DB encryption a couple months ago, I found a really nice tutorial that did what I needed, but now I can't seem to track it down.
Right now, I'm just trying to find out what I'm doing wrong. I have two columns in the table 'test': 'id' and 'data'. 'id' is just an AI INT and 'data' is a BINARY(128). Here's what I do as a test:
And it claims success, showing me a bunch of binary gibberish in the data field. When I try to read it:Code:INSERT INTO test (data) VALUES (AES_ENCRYPT('The quick brown fox jumped over the lazy dogs.','0123456789abcdef'));
it returns NULL... What am I doing wrong?Code:SELECT AES_DECRYPT(data,'0123456789abcdef') FROM test;
Disregard. I found my problem. The data field needed to be 'BLOB', not BINARY. Feel free to remove this thread.



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks