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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.