Solved

Using random iterations in password hashing.  Good or Bad?

Posted on 2016-08-10
4
66 Views
Last Modified: 2016-08-25
Hi there,
I am currently using individual salts per password in my hashing solution.

My understanding is that using salts helps to prevent people from using lookup and rainbow tables to crack the passwords.

Due to legacy issues I am using the PBKDF2 algorithm inside the .NET Rfc2898DeriveBytes cryptology class which I believe uses HMAC based on SHA1.  With this in mind I am looking at alterative ways to strengthen my password hashes.

I read a comment in an article that if you randomise the number of iterations for each password (iterations are stored with the salt for use when verifying password) that this also helps with beating rainbow table attacks.

As I can't find anywhere else that seems to mention this method I was wondering if anyone knew whether the randomising of iterations was actually a good idea or simply an unnecessary step?  Could it in fact be a bad idea?

My thoughts are that even a matching hash at a different iteration count wouldn't result in the hacker knowing the actual password.
0
Comment
Question by:SoLost
4 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 41751353
* You would still need a maximum hash iteration
* A cracker can check for a match in all intermediary hash iterations
0
 
LVL 5

Author Comment

by:SoLost
ID: 41751388
If that was the case then wouldn't that be true for any algorithm that has iterations?

Correct me if I'm wrong but a match at an intermediary iteration wouldn't result in them finding the actual password though.  Wouldn't they need to find a match at the final iteration in order to determine the password?
0
 
LVL 61

Accepted Solution

by:
btan earned 500 total points
ID: 41751495
"Randomisation" of the iteration counts just add to the complexity and security via obscurity is not going to make it a great leap in deterring the attacker eventual brute force attempts to break the secret derived from the PKCS#5 PBKDF2 scheme. It is also shared that PBKDF2 may be slow in computing on a CPU system but is much faster for a GPU system.

The "randomness" will not help if weak password is used and password is also predicative. If you are using PBKDF2 for deriving  a key to further perform other encryption needs, it is more to make the password "random" (like from form some strong PRNG) and not predicative like human derivable (or susceptible to dictionary attacks).  

In fact, NIST has a paper on "Recommendation for Key Derivation Using Pseudorandom Functions", specifically it advise on security strengthen that we need to be cognizant of which I doubt it is about making it further ambiguous with random iteration count
The encoding method shall be designed for unambiguous conversion of the combined input information to a unique binary string.
Unambiguous encoding for input data is required to deter attacks on the KDF that depend on manipulating the input data.

In this Recommendation, key separation is a security requirement for the cryptographic keys derived from the same key derivation key. The keys shall be separate in the sense that the compromise of some keys will not degrade the security strength of any of the other keys.
(pdf) http://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf
2
 
LVL 61

Expert Comment

by:gheist
ID: 41754919
If you change number of iterations you might weaken encryption (like introduce 'meet in the middle' problem)
Using lightly tweaked algorithm will require custom programming of password cracker, but it will not make cracking significantly faster or slower.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Article by: btan
Provide an easy one stop to quickly get the relevant information on common asked question on Ransomware in Expert Exchange.
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now