Welcome to WebmasterWorld Guest from 54.242.224.250

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

md5() hash

Up to 16 characters?

     
3:32 pm on Sep 24, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 9, 2006
posts:147
votes: 0


I md5 hash is 32 hexa characters (16 values per char). That means 2 hexa characters (16*16=256) are for one "normal" character. By my calculating that is 16 bytes per md5 hash. Is that true?
9:33 pm on Sept 24, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 12, 2004
posts:789
votes: 0


Bit of the old wiki can help: [en.wikipedia.org...]
11:35 am on Sept 25, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12541
votes: 1


Is this question being asked so you can determine how to store the md5 hash in a database? If so, a 32-character string is ideal.
2:19 pm on Sept 26, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 9, 2006
posts:147
votes: 0


Yes, i know that - but can i store 146 (for example) chars long text to md5 hash?
3:25 pm on Sept 26, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 13, 2006
posts:165
votes: 0


MD5 is a one way hash. You can store any length in a hash. You will always end up with a 32 character aplhanumeric string. You can not determine the original contents of that string from a hash value.
8:34 pm on Sept 27, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 9, 2006
posts:147
votes: 0


But that means that two different strings MUST have same md5 hash.
9:05 pm on Sept 27, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 6, 2005
posts:575
votes: 0


Yes, different strings can have the same MD5 hash.
1:42 pm on Sept 28, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12541
votes: 1


The term you are describing is collisions. I'm no mathematician but I do know there is something called combinatorics and if you search for the "Pigeonhole Principle" you'll find plenty of technical reading. In layman's terms, the Pigeonhole Principle says that if you have 13 pigeons but only 12 pigeonholes then at least one hole would contain at least two pigeons.

However, I think you can rest assured since, for a 16-byte hash, the odds of collision are extremely high -- 2^128