Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
What is php md5? How to use? Why use md5?

 
Post new topic   Reply to topic    dna88 Forum Index -> Web design and solution Discussion Forum
Author Message
emm
Power User
Power User


Joined: 13 Jul 2004
Posts: 310

Post Post subject: What is php md5? How to use? Why use md5? Reply with quote

I hear this term in many places but I do not have a clear idea on what md5 is or how this works with php. Do I need to install anything extra for md5 to work? Where and why should I use md5 with php?
_________________
“You might say reality is the result of complex negotiations between the observer and the observed. But that is simply a point of view…”
Digital Bangladesh
Sat Oct 16, 04 11:24 pm
Back to top
emm View user's profile Send private message
dude
Power User
Power User


Joined: 10 Mar 2004
Posts: 376
Location: Savar, Dhaka

Post Post subject: Php md5 explained Reply with quote

Md5 is an algorithm designed to verify data integrity. Reported to be much more reliable than checksum and other commonly used methods. 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 like RSA Data Security or PGP.

Md5 is built into php and it calculates the MD5 hash of str using the RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash. The hash is a 32-character hexadecimal number. If the optional raw_output is set to TRUE, then the md5 digest is instead returned in raw binary format with a length of 16.

You can read the whole article here:
http://www.faqs.org/rfcs/rfc1321

The md5() function is very useful for Password encryption. Keep in mind that we can not Decrypt it.

The most simplest method to use md5() function PHP with MySQL is as follows:

Insert the record into the MySQL Database using a query like:

Code:
$query = "INSERT INTO user VALUES ('DummyUser',md5('DummyPassword'))";


And then for matching the password use:

Code:
$password = md5($password);
$query = "SELECT * FROM user WHERE username='DummyUser' AND password='DummyPassword'";


In the above code you can use your Variables instead of DummyUser & DummyPassword.
Sun Oct 17, 04 7:49 am
Back to top
dude View user's profile Send private message Visit poster's website
emm
Power User
Power User


Joined: 13 Jul 2004
Posts: 310

Post Post subject: Reply with quote

Thanks dude.
_________________
“You might say reality is the result of complex negotiations between the observer and the observed. But that is simply a point of view…”
Digital Bangladesh
Mon Oct 18, 04 2:51 am
Back to top
emm View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Web design and solution Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group