Solved

Using random iterations in password hashing.  Good or Bad?

Posted on 2016-08-10
4
99 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 63

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 62

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

SuperAntiSpyware Licenses Discounted by 25% !

Exclusive offer to Experts Exchange Members!
Buy SuperAntiSpyware License(s) from us and save 25% on the regular purchase price.
- Includes Full SuperAntiSpyware Vendor Support Entitlements
- Your Subscription does not begin until you activate your license
- Buy for your friends

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 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