Answer the question
In order to leave comments, you need to log in
What is the best algorithm to use for password hash?
On Habré I read this advice "Do not use either MD5 or SHA1. It is best to use specialized hash functions for passwords, such as PBKDF2 or scrypt"
And I thought, can I redo it before it's too late?
I am currently using this
crypto.createHmac('sha1', salt).update(password).digest('hex');
Answer the question
In order to leave comments, you need to log in
Bycrypt right, buzz.
In general, the protection of user passwords in the database is calculated on the basis of:
a possible compromise of the system, let's say today you were hacked, the database was leaked, you need to grunt the passes. Of course, first of all, all kinds of finder.insidepro.com are used (comrades have collected a rather strong and impressive database) and other services, including cmd5.
From this, it can be logically understood that in order not to immediately remain in a puddle, it is imperative to use an algorithm with salt. So that your users live in peace for a little more time)
And then a simple calculation goes on, for example, md5 average is somewhere around 10M / hs, roughly speaking, if the password policy includes at least 8 characters of different case and the use of symbols, hashcracking will drag on for about a week to find 90-95 % of passwords.
We draw the following conclusions: if the usual md5 - make a policy of changing passwords weekly
if bycypt (blowfish) - you can limit yourself to a six-month or annual period of mandatory password changes.
Ps In last year's hashrunner contest at PHDays 2015, our and other teams didn't get 1 bycrypt cracked, although I may be wrong about the leading team. But IMHO, just don't waste time on it. We took 4th place, a little behind 3rd. Considering that the first 3 are the permanent leaders and fathers of hashcracking (hashcat/insidepro/jhontheripper)
That's it. I think the issue will be resolved)
And I hope this is a very serious approach to security? Or negligence in protecting the system itself, in other words - are you almost sure that your database will be merged?))
security.stackexchange.com/questions/70947/how-doe...
https://medium.com/@mpreziuso/password-hashing-pbk...
blog.ircmaxell.com/2014/03/why-i-dont -recommend-sc...
You should write your code in such a way that at any moment it is fashionable to add another hasher over the existing one . Better yet
, use a solution that has already been tried, attacked and survived
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question