Jump to content

data encryption


sneskid

Recommended Posts

I know PHP has methods to encrypt strings of data. 1 use being that when data is stored in a DB people looking at the DB won't accidentally see sensitive data.

This method doesn't help again DB hijacking does it? Because someone can just use the same method to decrypt the stored data.

I'm curious how it works and where to start leaning it, I would like to apply encryption on some of my fields.

Any info would be appreciated. Thanks
Link to comment
Share on other sites

many people use sha1() to generate a hashed version of the string you want to protect. This is a one-way process, no un-sha1() function. Store the hashed version of the string in your database.

$string = 'secret';
$encoded = sha1($string);

if (sha1($user_password) === $encoded)
{
// both encoded versions match

}
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.