Hamumu Software Hamumu Software Hamumu Software
Name
Password Register
Latest Journal update: Nov 2, 2017
Old 10-30-2008, 05:24 PM   #1
Julian
Is a ninja
 
Julian's Avatar
 
Join Date: Aug 2005
Location: http://www.nationstates.net/dordinal
Posts: 3,077
Send a message via MSN to Julian
Default MD5 Stuffs

I was thinking... If every file in the world has a unique md5 checksum, then why not be able to create a program that takes an MD5 sum and make a file?

*********
Julian is offline   Reply With Quote
Old 10-30-2008, 05:25 PM   #2
fourwind
Lord of Blobs
 
fourwind's Avatar
 
Join Date: Apr 2008
Location: The Sunny meadows asylum.
Posts: 319
Default Re: MD5 Stuffs

WOW. That would be cool. Make a random generator of these, AND THEN CONVERT EM! you could make programs that do absoloutly NOTHING useful. Or you could make awesome programs. Like, wow. this is cool. it makes squares on the screen. ;3
__________________
Fourwind

fourwind is offline   Reply With Quote
Old 10-30-2008, 06:25 PM   #3
Jamul
Marshmallow Head
The Boss
 
Jamul's Avatar
 
Join Date: Jun 2003
Location: Hamumu HQ
Posts: 6,118
Default Re: MD5 Stuffs

Because they're not completely unique. Any time you take X amount of information and scrunch it into Y (smaller) amount, there clearly has to be some overlap! MD5 is just a very big number, so it's outrageously unlikely for any 2 files to share a number.

Think of it like this: If a file has 100 bytes in it, that file could contain any 256^100 (each byte can be any of 256 different values) different combinations of values. MD5 is... 32 bytes? I don't recall. It can only be 256^32 different values. So there will be ones that share an MD5, even among files that are just 100 bytes. Stick it in a calculator though, and you find that the numbers involved are unbelievably large, and the odds of getting two files with the same code are just about inconceivable. But it still can happen.
__________________
Jamul is offline   Reply With Quote
Old 10-30-2008, 07:12 PM   #4
Julian
Is a ninja
 
Julian's Avatar
 
Join Date: Aug 2005
Location: http://www.nationstates.net/dordinal
Posts: 3,077
Send a message via MSN to Julian
Default Re: MD5 Stuffs

Well then, make a format that isn't (as) compact and generates as much as is needed to make a number completely unique! So, for smaller files, the hash would be smaller, and for bigger ones, it would be much bigger. But it would all be worth it.
Julian is offline   Reply With Quote
Old 10-30-2008, 08:35 PM   #5
Jamul
Marshmallow Head
The Boss
 
Jamul's Avatar
 
Join Date: Jun 2003
Location: Hamumu HQ
Posts: 6,118
Default Re: MD5 Stuffs

Logic dictates that the number that would be exactly unique for any given arrangement is... exactly the size of the arrangement!
__________________
Jamul is offline   Reply With Quote
Old 10-30-2008, 08:56 PM   #6
Julian
Is a ninja
 
Julian's Avatar
 
Join Date: Aug 2005
Location: http://www.nationstates.net/dordinal
Posts: 3,077
Send a message via MSN to Julian
Default Re: MD5 Stuffs

Although, if you used a whole lot of characters to make the arrangement, rather than hex, than it would end up being shorter, correct? There are 10 numerical digits and 26x2 letters, so if you came up with a format that used that, then you'd have a better format that was more compact than the file itself.
Julian is offline   Reply With Quote
Old 10-31-2008, 05:37 AM   #7
SpaceManiac
Veteran Programmer
 
SpaceManiac's Avatar
 
Join Date: Oct 2007
Posts: 3,078
Default Re: MD5 Stuffs

And how would you store it? Just in a text file, like

12ada331ADDW

? This wouldn't work - each character in a normal text file takes up a whole byte.
SpaceManiac is offline   Reply With Quote
Old 10-31-2008, 06:43 AM   #8
Mr.Onion
Evil, random-voting vegetable
 
Mr.Onion's Avatar
 
Join Date: Mar 2005
Location: Down at the shore where there's no-one vacationing.
Posts: 4,862
Default Re: MD5 Stuffs

Quote:
Originally Posted by Julian View Post
Although, if you used a whole lot of characters to make the arrangement, rather than hex, than it would end up being shorter, correct? There are 10 numerical digits and 26x2 letters, so if you came up with a format that used that, then you'd have a better format that was more compact than the file itself.
This is called ASCII.

Also, it is not possible to get a file from an MD5 for another reason: The MD5 algorith is designed in such a way that it's very nearly impossible to do this, and the only way is to brute-force it. (MD5 strings are 256 characters long, so this takes you a couple of decades at the minimum.)

Quote:
Originally Posted by Jamul View Post
Logic dictates that the number that would be exactly unique for any given arrangement is... exactly the size of the arrangement!
Although, if you're doing a hash for whatever reason, SHA-1 doesn't produce a collision, as far as anyone can figure out.
__________________

Last edited by Mr.Onion; 10-31-2008 at 06:45 AM.
Mr.Onion is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Quoting Stuffs Along with Pudding Boneheads Total Mayhem 4 07-15-2011 09:12 PM
To: AtkinsSJ Re: Twitter Stuffs Julian Total Mayhem 3 04-28-2009 07:23 AM


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.
Site Map
Copyright 2017, Hamumu Games Inc.