I am thinking about encrypting some fields in MySQL database using MySQL's encryption functions. I can't find any good sources on how to properly implement it. Has anyone done this and have a good tutorial on this?

I would like to implement salt along with encryption key. I have found out that AES_ENCRYPT is better off with a fixed length key from [mysql AES_ENCRYPT key length][1] post. Has anyone written a MySQL function for key derivation algorithm?

**EDIT:**  
For example, I have found a tutorial - [Encrypt MySQL data using AES techniques][2], but it does not go into enough depth at all.

**EDIT 2:**  
I am trying to query encrypted fields directly from the database. It is a small project, so it is not likely that someone will write an application front end for this.

  [1]: https://security.stackexchange.com/questions/4863/mysql-aes-encrypt-key-length
  [2]: http://thinkdiff.net/mysql/encrypt-mysql-data-using-aes-techniques/