I am using the codeigniter encryption class to encrypt card numbers that are stored in a database.
Here is the problem, if I encrypt say card number 823 and it produces 23wofj2398v, I can decrypt it and there is not problem I get back 823. But if I encrypt it again I get xc9878dhjj (something different)... it still decodes to 823. But why do the two encryptions not produce the same result if I am using the same #.
Because I want to store the encrypted string in the database. And later when someone searches for 823, I want to encrypt 823 again and search mysql for that encrypted string, but because it is producing different results, I can't search the database for that encrypted string. Any suggestions how to get it to produce the same encrypted string?