crypt and decrypt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lazandra
    New Member
    • Sep 2007
    • 25

    crypt and decrypt

    Hiya

    I have used the php function crypt to encrypt a credit card number thats going to be stored in mysql. does anyone know what funtion to use to decrypt it?

    Cheers
    Laz
  • gm04030276
    New Member
    • Nov 2006
    • 17

    #2
    there is no decrypt function, its a one way process. otherwise if anyone got into your database they could just decrypt all the credit card numbers, infact any two way hashing and unhashing will be like this.

    If you need to store them in a retrievable way that is a bit encoded, use rotate13 or base64 encoding, that can be undone otherwise just use plain text.
    Hashes are irreversible

    Comment

    • Lazandra
      New Member
      • Sep 2007
      • 25

      #3
      Cheers thanks for that ;-)

      Laz
      xxxx

      Comment

      • JeremyMiller
        New Member
        • Sep 2007
        • 69

        #4
        Consult an attorney! You do not want to be the next news story about losing credit card information and be sued for millions! In general, you should not store cc numbers on a server and doing so is probably breaking the law as well as your payment processor's TOS.

        Also, hashes by definition are not 2-way, but 1-way functions. Their usefulness comes from that fact. For instance, if you store a password hashed, you'll never know the user's password. To log them in, though, you hash whatever they enter and compare the hashes -- if equal, you may assume the password is correct.

        Comment

        Working...