Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Algorithm for one way password encryption

What is the most secure one way encryption algorithm to encrypt passwords?

MD5 and SHA (1..512) are frequently used, but they are designed for speed what is bad for preventing brute force attacks on encrypted passwords.

The algorithm shouldn't be too exotic, so that it can be used with common programming languages / runtimes like Java, .NET or Python.

like image 812
deamon Avatar asked Aug 02 '11 11:08

deamon


2 Answers

BCrypt or SCrypt. Why? because they where designed to be slow instead of fast.

see also: How to securely hash passwords? on security.stackexchange.com

like image 117
Jacco Avatar answered Sep 27 '22 02:09

Jacco


Hashing alone won't save you, as can be read in other posts on the topic.

bcrypt and scrypt are indeed good choices, but they're not supported out of the box by most languages. Although it really shouldn't be a problem to find a library that supports them. In addition to these two, you could use password-based encryption (PBE) as described in PKCS#5, ideally with PBKDF2. There should be built-in support for PBE almost anywhere.

like image 31
emboss Avatar answered Sep 26 '22 02:09

emboss