SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP and MySQL Cipher Text Matching

    Hello

    I want to encrypt data in mysql database, that can be done in PHP and then stored to database OR that can be encrypted and stored (both) in MySQL.

    The problem is that, I want to display the records (when the client is login) in A-Z Order, now, i tried to use order by clause, but that is not working, as the column is encrypted. Therefore, I need a guidance, tutorial, etc, where some PHP Encrypt / Decrypt function returns same results as MySQL Encrypt / Decrypt function, so that i can sort the table on encrypted column.

    Please guide !

    Thanks
    Zeeshan Hashmi

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Have you looked at AES_ENCRYPT() and AES_DECRYPT()?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    The solution is very easy. Don't encrypt the data unless its valuable data.
    Since you are using it for sorting it must not be that valuable.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •