Many times you need a quick encryption solution in a database but do not want the overhead of coding something more complex. mySQL provides you with a simple encryption solution directly in the sql query.

TO ENCRYPT:
INSERT INTO users (user, pass) VALUES (‘$username’, AES_ENCRYPT(‘$pass’, ‘secret encryption key’));

TO DECRYPT:
SELECT user, AES_DECRYPT(pass, ‘secret encryption key’) FROM users

del.icio.us:Encrypt and Decrypt Strings in mySQL sql Queries digg:Encrypt and Decrypt Strings in mySQL sql Queries spurl:Encrypt and Decrypt Strings in mySQL sql Queries wists:Encrypt and Decrypt Strings in mySQL sql Queries simpy:Encrypt and Decrypt Strings in mySQL sql Queries newsvine:Encrypt and Decrypt Strings in mySQL sql Queries blinklist:Encrypt and Decrypt Strings in mySQL sql Queries furl:Encrypt and Decrypt Strings in mySQL sql Queries reddit:Encrypt and Decrypt Strings in mySQL sql Queries fark:Encrypt and Decrypt Strings in mySQL sql Queries blogmarks:Encrypt and Decrypt Strings in mySQL sql Queries Y!:Encrypt and Decrypt Strings in mySQL sql Queries smarking:Encrypt and Decrypt Strings in mySQL sql Queries magnolia:Encrypt and Decrypt Strings in mySQL sql Queries segnalo:Encrypt and Decrypt Strings in mySQL sql Queries