How to insert a value by encrypting and should be able to get this by decrypting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amar

    How to insert a value by encrypting and should be able to get this by decrypting

    Hi All,
    I want to insert my password into the mysql database by encrypting it
    so that I can also retrieve the password. Before I was using sha1()
    for encrypting password,but it is an one way method.
    I want to use a function that can be decrypted . Please help me.

    Thanks
    Amar

  • Rik

    #2
    Re: How to insert a value by encrypting and should be able to get this by decrypting

    On Mon, 12 Feb 2007 12:14:51 +0100, Amar <ghungur.2006@g mail.comwrote:
    Hi All,
    I want to insert my password into the mysql database by encrypting it
    so that I can also retrieve the password. Before I was using sha1()
    for encrypting password,but it is an one way method.
    I want to use a function that can be decrypted . Please help me.
    DES_ENCRYPT() / DES_DECRYPT() in MySQL, or look at mcrypt in PHP:
    <http://nl3.php.net/manual/en/ref.mcrypt.php>

    --
    Rik Wasmus

    Comment

    • Michael Fesser

      #3
      Re: How to insert a value by encrypting and should be able to get this by decrypting

      ..oO(Amar)
      >I want to insert my password into the mysql database by encrypting it
      >so that I can also retrieve the password. Before I was using sha1()
      >for encrypting password,but it is an one way method.
      That's how it's supposed to be. Passwords should never be stored in a
      decryptable way. If a script can decrypt them, an attacker can do that
      as well.

      Storing just a (salted) password hash is fine. If a user forgets his
      password then he should get a new one.

      Micha

      Comment

      Working...