8 Users Commented In This Post

Subscribe To This Post Comment Rss Or TrackBack URL
Martin Cochran says, February 7th, 2008   

I am currently writing my dissertation on cryptographic hash functions.

A few picky clarifications:
- MD5 is a deterministic function, not non-deterministic.
- Use of the words ‘encryption’ and ‘cipher’ with regard to hash functions doesn’t really make sense. Similarly, ‘plaintext’ and ‘ciphertext’ aren’t really applicable. Probably clearer to use ’string’ or ‘message’ and ‘hash.’
- Hash functions are used for many, many more applications than storing passwords and file integrity checks. SSL, IPSec, TLS, and every other crypto library out there uses them for many, many different crypto applications (digital signatures, MACs, authentication schemes, commitment protocols, etc).
- The paragraph after you mention the birthday paradox is actually a second preimage attack (the second kind you mention) and the birthday paradox does not apply.
- MD5 is considered *very* broken. SHA-1 is less so, but if developing a new application (and you shouldn’t be developing a crypto application if you’re not a cryptographer, but that’s another story), use SHA-256, SHA-384, or SHA-512.
- Adding a salt to the password hash is a useful technique, as you mention. However, the article to which you link has a number of problems as well, which I do not have space to go into here. Poke around on wikipedia and see if you can’t find out for yourself what the problems are.

Bilal says, February 7th, 2008   

Wow. This is a great explanation of hashing in general, although maybe not the differences between hashing algorithms.

Daniel says, February 7th, 2008   

Hi Stefan!

This promises to be so cool! I love the fact that it’s in depth as well, I don’t even have time to read it all, fantastic! I’m bookmarking and coming back :)

Stefan says, February 8th, 2008   

Well then..

Guess I should clarify one thing: This - as well as the follow-ups - is NOT going to be an expertise for IT-specialists in their 8th semester. This is for interested “normal” people that want to take a closer look, and therefore will stay this - hopefully balanced - way.

@Martin Cochran
- whoops! Lost in translation… corrected.
- very debatable. I see your point though. Please remember english is not my native tongue.
hash-functions are nonetheless cryptographic functions. Also, have you counted how often I used “hash” in this short text? Try imagine how much more there would be without “ciphertext” :p
- of course they are, though the ones I mentioned are the ones the average user has immediate contact with. Many have seen the MD5 hash below a download link, and everyone has a hash-stored password somewhere. I have to somewhat limit this to a readable length.
- ..well then. the birthday paradox DOES apply to finding collisions and therefore “collision attacks”, reducing the average number of operations from 2^n to 2^(n/2). the second preimage attack differs from that one, that I try not to find any pair, but a certain second “message” to a given first message m1.
- Since Cryptography is a living science and not a rather-dead-one-for-rather-dead-people, one’s opinions may differ. MD5 is broken, alright, but there are worse things. Like DES.
Plus, I never said anything about developing a _cryptographic_ piece of software, but nigh every software today has a user management. I don’t like plaintext-stored passwords, and I don’t like a hash or cipher used for them a five-year-old can crack. So it is rather important that “normal” developers without specialization on cryptos also get a hang on this. And as I already mentioned, SHA-512 would be the way to go.
- Like most of the things I write, this is NOT a step-for-step-tutorial and shouldn’t be regarded as a reason to stop thinking. It should give a very brief view of the thematics of hashes. I have yet to implement the salted hashes, and if one ever gets the feeling the linked tutorial is weak, he may post or even write a better one. Please do remember, these are all just ideas, to get people interested in stuff like that, for it is to become a point of major interest.
As for the problems you mentioned, yeah, when thinking about I find two without even considering wikipedia. So would others.

Thanks for the corrections and feedback though.

@Bilal: Thank you very much

@Daniel: I hope so! :) I think it’s a bit too long, gonna have to shorten things a bit in the future.

Let me please say it again: This is NOT the wisdom of galaxies. I do NOT claim to be an expert on this kind of things (as always). I know more than some people though, and I wanna share, since I have major interest that more people get used to this stuff, get interested, and eventually get more and more interested in using it to protect themselves and others as well.
I write ideas, not dogmata, in a way that’s hopefully pleasing readers. Everyone could, at any hour, hop over to wikipedia and look for “those hash functions I wanted to know about for half my adult life”, but few do. Plus, it’s much easier to understand when presented in such a matter.

Thanks.
And: Delete All Cookies! ;)

Martin Cochran says, February 8th, 2008   

@Stefan: I hope I didn’t come across as too snooty. Your reply makes a lot of good points. It’s great that so many people are interested in cryptography, and there’s certainly nothing wrong with stirring interest in the topic. Every programmer could use more knowledge about security, for sure.

Also, some security tends to be better than no security, and the simple salted-hash-of-password scheme linked to may work for a small site with a limited threat/risk. Just know that if a project starts to get big (and you attract more sophisticated hackers), all crypto-related code needs to be replaced with industry-standard stuff at some point.

Stefan says, February 8th, 2008   

@Martin: Since I like being honest, and get the feeling I can be honest here as well, I gotta admit it came rather snooty (didn’t knew that word before ;). BUT (!) I’m kinda …let’s call it sensitive in means like this, so I gotta excuse me for snapping at you.

You’re pretty right about the second point though, one should know the limitations of the security implemented. As you probably guessed by now, I was trying to reach a target audience representing much smaller projects and such. The big ones should probably be able to handle themselves, or at least I’d like to believe that *looks at the Microsoft example* …nevermind.
Nah, I try to reach the more private persons here. Open-Source-Freaks, Forum guys, blogees. Watch out for your private data! And if you happen to get these from other people, be responsible as well with them. That’s the kind of message I’d like to get through.
No hacker that’s out for easy prey will continue cracking your database with forum users if it gets expensive.
That’s like the base rule of security for me I forgot to mention, but will do in the future ;)

“A system is secure enough, if the amount of effort (time, money and else) to break it is far greater than the use of the broken system”

or something like that.. should get more catchy. :)

Anyways, no hard feelings here. I’m a man of rhetorics and I’m somewhat a pro in my business as well (at least for my young age ;), I just ..decide willingly to play in the minor league.. like it better here ;) and let the players that are really up to it handle the big ones..
though I gotta admit it sometimes limits my horizon to the level of the above text..

anyway. cheers!

PS: No sewing tips whatsoever. I’m shocked. ;)

3 says, February 9th, 2008   

http://www.ghacks.net => B5A8AD3A9CDD6A6953FCBE6975FDE734

You weren’t lying when you said it was easy

Stefan says, February 9th, 2008   

…’course not ;)

but its , without the http://

Edit: *lol* The damn wordpress just added it… my bad..

Here, catch a snack!! *waveswithcookie* ;)

Leave Your Comments Below
Hello, please leave your thought below

Please Note: Each comment will be manually approved by an admin. There is no guarantee that a comment will be posted. Please do not submit the comment multiple times.