Posted by: prankster February 21, 2011
Login in to Rate this Post:
0
?
if you want to code, you can go with Ayus, also heard MD5 is not that good for password protection, try using sha digests.
I found some inbuilt functionality with mysql (always easier and less error prone to use inbuilt api)
src:http://mysqldatabaseadministration.blogspot.com/2006/08/storing-passwords-in-mysql.html
You can apply SHA1 algorithm to a password string:
Since SHA is an alias for SHA1, it produces the same result
To store passwords encrypted with SHA1, we need to be able to store 40 characters.
On the other hand, to store passwords encrypted with MD5, we need the column to be able to hold 32 characters.
I found some inbuilt functionality with mysql (always easier and less error prone to use inbuilt api)
src:http://mysqldatabaseadministration.blogspot.com/2006/08/storing-passwords-in-mysql.html
You can apply SHA1 algorithm to a password string:
mysql> SELECT SHA1('mysecretpassword');
+------------------------------------------+
| SHA1('mysecretpassword') |
+------------------------------------------+
| 08cd923367890009657eab812753379bdb321eeb |
+------------------------------------------+
1 row in set (0.00 sec)
Since SHA is an alias for SHA1, it produces the same result
mysql> SELECT SHA('mysecretpassword');
+------------------------------------------+
| SHA('mysecretpassword') |
+------------------------------------------+
| 08cd923367890009657eab812753379bdb321eeb |
+------------------------------------------+
1 row in set (0.00 sec)
To store passwords encrypted with SHA1, we need to be able to store 40 characters.
mysql> SELECT CHARACTER_LENGTH(SHA1('mysecretpasswordsssssss'));
+---------------------------------------------------+
| CHARACTER_LENGTH(SHA1('mysecretpassword')) |
+---------------------------------------------------+
| 40 |
+---------------------------------------------------+
1 row in set (0.00 sec)
On the other hand, to store passwords encrypted with MD5, we need the column to be able to hold 32 characters.
mysql> SELECT MD5('secretpassword');
+----------------------------------+
| MD5('secretpassword') |
+----------------------------------+
| 2034f6e32958647fdff75d265b455ebf |
+----------------------------------+
1 row in set (0.00 sec)
mysql> SELECT CHARACTER_LENGTH(MD5('secretpassword'));
+-----------------------------------------+
| CHARACTER_LENGTH(MD5('secretpassword')) |
+-----------------------------------------+
| 32 |
+-----------------------------------------+
1 row in set (0.00 sec)
Didnt find much on oracle except for following http://psoug.org/reference/dbms_crypto.html Good luck