kidmizere on 12/08/10
Last Edited at 12/08/10 12:48pm
## Adding and testing AES encrypted password field DROP TABLE IF EXISTS `testGKAES`; create table `testGKAES`(`uid` int(15) not null AUTO_INCREMENT,`ufname` varchar(15),`upassword` BLOB,primary key(`uid`)); INSERT INTO testGKAES VALUES('1','user', AES_ENCRYPT('password', 'key') );INSERT INTO testGKAES VALUES('2','mere', AES_ENCRYPT('balloon', 'key') );INSERT INTO testGKAES VALUES('3','kurtasg', AES_ENCRYPT('zebra', 'key') ); SELECT * FROM testGKAES WHERE ufname='user' AND upassword=AES_ENCRYPT('password','key');SELECT * FROM testGKAES WHERE ufname='mere' AND upassword=AES_ENCRYPT('balloon','key');SELECT * FROM testGKAES WHERE ufname='kurtasg' AND upassword=AES_ENCRYPT('zebra','key'); SELECT AES_DECRYPT(upassword,'key') FROM testGKAES;
Report this snippet Tweet
Comment:
You need to login to post a comment.