Welcome to WebmasterWorld Guest from 54.196.238.210

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

md5() hash

Up to 16 characters?

     

rokec

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

5+ Year Member



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?

ahmedtheking

9:33 pm on Sep 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Bit of the old wiki can help: [en.wikipedia.org...]

coopster

11:35 am on Sep 25, 2006 (gmt 0)

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



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.

rokec

2:19 pm on Sep 26, 2006 (gmt 0)

5+ Year Member



Yes, i know that - but can i store 146 (for example) chars long text to md5 hash?

Moosetick

3:25 pm on Sep 26, 2006 (gmt 0)

5+ Year Member



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.

rokec

8:34 pm on Sep 27, 2006 (gmt 0)

5+ Year Member



But that means that two different strings MUST have same md5 hash.

barns101

9:05 pm on Sep 27, 2006 (gmt 0)

5+ Year Member



Yes, different strings can have the same MD5 hash.

coopster

1:42 pm on Sep 28, 2006 (gmt 0)

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



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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month