|
|||||||||||
|
Re: SHA-1 vs. triple-DES for password encryption?
From: Dana Epp <dana(at)vulscan.com>
Date: Sat Nov 09 2002 - 11:54:10 EST Hey Craig, Instead of weighing the pros and cons of the algorithms, lets attack this from a different perspective. Firstly, it is good that understand it would be better to use a standard algorithm rather than a home-grown one. As these have been vetted by the crypto gurus smarter than us there is a better chance that your home-grown one may not be able to stand up to the hostile world of networked users. Then again, maybe it can. But why chance it? Both SHA-1 and 3DES have been reviewed for some time. With that said, lets look at what you are trying to do. You are wanting to store some secret (a password) to a media potentially accessible by others. The obvious issue off the bat is if someone can read this data, what can they gain from it? The second part to this is that if you use any sort of algorithm that requires the key, how do you control and protect the key itself? This is where a hash comes in nicely. SHA-1 is a hashing algorithm, and one of the only secure hashing algorithm that was FIPS approved. Its whole purpose is to provide a mechanism as a "verifier". This is good as if the application is compromised, less risk is exposed as the "secret" is not accessible, just a hash of it. Further to this, you could "salt" the hash making it more difficult to brute force it. This is good as if two users happen to have the same secret, you can not tell if each hash has its own unique salt. One limitation in your case is that if you are only wanting to store 8 bytes, you want most of that to be a unique hash, and NOT the open salt. If you do only use 8 bytes, saving 2 for the salt seems to have been common place. I apologize if you already know all this, but its good to understand what you are trying to go. If at all possible, it is a better technique to NOT store secrets when you don't have to. It minimizes the risk associated with doing so, with protecting of external elements (like keys), and limits the complexity of the application development. The last one some on the list may disagree with, and that is their right. I find that the easier it is to understand and apply correctly, the less likely it will be bug ridden, easier to maintain, and still accomplish the same security goals as set up in the design specification, matched against the threat model. To answer your question about truncation, I really don't know how to answer this without understanding what the risks are you are exposed to. Also, I am always one for the larger (while still being reasonable) the hash, the better. Assume that an attacker can read the code and know your offset. If you are only using 8 bytes (64 bits) you shorten the time it takes to brute force it if they ever were able to retrieve the stored hash. This is one of many of the reasons shadow passwords were introduced in Unix environments. Longer passwords and hashes aid in making the hash much harder to work with. To the point of "hurting the algorithm" with truncation, this won't happen, since its one-way and you are segmenting it off AFTER it has already been hashed. You never have to jam the truncated hash back into the algorithm, you just need to compare it against what the user entered. Apply the same technique to the user's hash as you did to the stored verifier, and you should be fine. Although SHA-1 is still very strong, NIST has released SHA-256, SHA-384 and SHA-512. (Check out http://csrc.ncsl.nist.gov/cryptval/shs.html for more info). Perhaps these could be made available to your mainframe. I would check. I would also check to see if you can take advantage of any OS security functionality that may assist you. Part of the K.I.S.S. principle is taking advantage of what you got, instead of having to build something from scratch. Whatever you decide, good luck. Hopefully my meandering bellowing is useful to you in some context. Again, good luck. --- Regards, Dana M. Epp ----- Original Message ----- From: "Craig Minton" <CraigSecurity@blazemail.com> To: <secprog@securityfocus.com> Sent: Tuesday, November 05, 2002 1:01 PM Subject: SHA-1 vs. triple-DES for password encryption?Received on Sat Nov 9 21:58:28 2002 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:43 EDT |
||||||||||
|
|||||||||||