Is MD5 safe, depending on what you use it for and how.
For message integrity, MD5 is no longer suitable because there is an attack to search for an alternative message with the same hash.
To store passwords in an MD5 database is acceptable , suppose you salt correctly. For this use, a known attack is completely unimportant.
If you are in paranoia mode, you can use a more complex scheme, for example, bcrypt, but for most people, saving a salty password is good enough. This prevents the lightest, most obvious attack, is easy to implement, hard to make mistakes, and has little overhead.
Note that two different passwords having the same hash value are not really a problem under normal conditions. It happens so.
Having said that using SHA instead of MD5 is really worth nothing. It has more bits, no known attack, and is supported by every half of a decent library.
Damon source share