Re: Dupe file check using MD5?

From: Date: Thu, 27 Jul 2000 21:02:57 +0000
Subject: Re: Dupe file check using MD5?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-8664@lists.php.net to get a copy of this message
This is copie dfrom the w3c page on md5 --snip-- The MD5 algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. The MD5 algorithm is intended for digital signature applications, where a large file must be "compressed" in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA or PGP. --snip-- So, I _think_ this means that distinct files should produce hashed. Here is the site this came from: http://www.w3.org/TR/1998/REC-DSig-label/MD5-1_0 Ed ""Ed Vul"" <edv@whitepj.com> wrote in message news:8lq7of$anl$1@toye.php.net... > Starting with the off topic first: I don't believe JavaScript has the > ability to access files, (for security purposes) > > and you want to make an MD5 hash of the whole file, or just the filename? > > Ed > > ""Some Guy"" <thatphpguy@hotmail.com> wrote in message > news:20000727070713.4735.qmail@hotmail.com... > > I have an upload script. I would like to compare a file uploaded with a > data > > base entry for dupes. > > > > I thought I could use the md5 function to generate a hash of each file and > > enter it in a database but the md5 function takes a variable not a file. > > > > Any ideas how a md5 hash can be generated on a uploaded fle. > > > > Files could be gifs,zips or doc files or many others including text files > so > > it has to be binary safe and text safe. > > > > How safe is this for comparing for dupes and anyone have stats on the > chance > > it would have the same hash for a non dupe. On a off topic idea. Anyone > know > > if there is a javascript way to read a file on the client side and > generate > > a MD5 hash. I could then pass it in a hidden field before the upload. > Saving > > the upload time if its already on the server. > > > > Thanks > > ________________________________________________________________________ > > Get Your Private, Free E-mail from MSN Hotmail at > > http://www.hotmail.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#8664) next »