Jump to content

php encryption


caster001

Recommended Posts

Hi Everyone...

PHP encryption *breathes* in a nut shell..is there any easy way to encrypt data to a database, then later check a user input against it?
Because I'm looking at the crypt() thing, but apparently..it's a one way encryption..but on that IBM site...I'm not sure how many of you have seen
it http://www-128.ibm.com/developerworks/library/os-php-encrypt/index.html well under listing.6 it says you can just simply run the same
encryption method (in this case md5) against it and you can decrypt or compare by doing that...

Well that didn't work for me...

Any thoughts?
Link to comment
https://forums.phpfreaks.com/topic/28351-php-encryption/
Share on other sites

I tried encryption for almost 2 months, I like the mcrypt library, but it takes months, and months to really leard.
Just run it through an md5($variable)
then when you check it check it like this

// first when you store the data
like a password

// store data
$password = mysql_real_escape_string(md5($_POST['password']));
// later on retrieval
$password = "whatever"; // this would be the user inputted password
if (md5($password) == $storedpassword ) {
echo "login correct";
}
Link to comment
https://forums.phpfreaks.com/topic/28351-php-encryption/#findComment-129724
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.