Jump to content


Photo

data encryption


  • Please log in to reply
2 replies to this topic

#1 sneskid

sneskid
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 15 April 2006 - 06:40 AM

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

#2 DougieB2

DougieB2
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 15 April 2006 - 07:22 AM

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

}


#3 sneskid

sneskid
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 15 April 2006 - 07:28 AM

ooooooooh

i get it... that's so cool... thank you!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users