How to Store 3DES encrypted String in MySQL column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepavelu
    New Member
    • Dec 2007
    • 7

    How to Store 3DES encrypted String in MySQL column

    plz tell me how to store a string encrypted by 3DES algorithm.i want to store password column to be stored by using this algorithm.
    Thanks.
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    When you use the mcrypt_encrypt command to encrypt, you know that the returned crypttext string can be larger that the size of the data that is encrypted.
    So your MySQL table column must be large enough to hold the largest.

    Since it is a password, it will probably no longer than 24 chars.

    To be on the safe side, it does not hurt to make the table column a VARCHAR with enough chars to contain your crypt result.

    Ronald

    Comment

    Working...