Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using random iterations in password hashing.  Good or Bad?

Posted on 2016-08-10
4
Medium Priority
?
134 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 46

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 65

Accepted Solution

by:
btan earned 2000 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

Automating Your MSP Business

The road to profitability.
Delivering superior services is key to ensuring customer satisfaction and the consequent long-term relationships that enable MSPs to lock in predictable, recurring revenue. What's the best way to deliver superior service? One word: automation.

Question has a verified solution.

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

The Cyber News Rundown brings you the latest happenings in cyber news weekly. Who am I? I’m Connor Madsen, a Webroot Threat Research Analyst, and a guy with a passion for all things security. Any more questions? Just ask.
This article is written by John Gates, CISSP. Gates, the SNUG President-Elect, currently holds the position of Manager of Information Systems at Lake Park High School in Roselle, Illinois.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

670 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