note 57134 added to function.md5

From: Date: Sat, 24 Sep 2005 22:48:31 +0000
Subject: note 57134 added to function.md5
Groups: php.notes 
Request: Send a blank email to php-notes+get-95727@lists.php.net to get a copy of this message
Md5 hashing is not designed for storing passwords in a secure way, nor is it designed for securing information. It was designed with the purpose of checking/validating data packages, e.g. I can send a package of 1 megabyte of data to my server, and send a 32byte string following it, which is a calculation from the package. If the calculated hash of the package does not match the 32 byte string, one or other was corrupted on route. It is actually this system that allows uploading of files via nearly every ftp program, and packet transfer via the internet. MD5 is also used for creating simplified data structures where the length is important. This is used in Mircosoft Word's dictionary, for example, where the array size would have to be large to allow for antireestablishmentarianism, or complex words (e.g. 1-2-dimethylethyl2floro3chlorobenzanol), as the memory consumption would be huge, as all words would have the same space allocation. Since the recurrance rate of the md5 algorithm is small (approx 128!/26!x2^128), we store the 32 byte hashes instead. this is more efficient. MD5 is not a secure algorithm for the internet, and was never intended to be. SSL uses SHA1 and SHA2, which is a SECURE HASHING ALGORITHM. This is intended for passwords, and is used by microsoft programs using password locking. Please note that information is LOST by rehashing on hashes (chaining), and makes them less secure, even if the hashes are different. Also note that due to the information loss, it is practically impossible to reconstruct a string from it's hash, despite the low reccurrance rate. Statistically, you are most likely to have a secure password if you use an almalgamation of a large amount of data, and then SHA1 it. This data should include the username, password, and any other unique information about the user that you know at the time of logging in. This way, you are more likely to have a secure password system, and this can be statistically proven. ---- Manual Page -- http://www.php.net/manual/en/function.md5.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57134 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57134&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57134&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57134&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57134&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57134&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57134&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57134&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57134&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95727) next »