In registration form of my web application I have a password field. Now when I am inserting the data in the database on the submit button.
Approach 1:
I use md5 function to generate a hash value of it and then I save the encrypted data into the database.
Approach 2:
I use the query in MySql to directly convert the particular column data into the hash value.
Which approach has less overhead and which one is more secure across the network. Please help?
Database used: MySql 5 , FrontEnd: Java