Welcome Guest, Not a member yet? Register   Sign In
comparing encoded values
#1

[eluser]GeXus[/eluser]
I'm using the Encryption Class to encode and decode credit card numbers.

I'm trying to lookup first to see if a particular card number already exists, but the encoded value's change each time you encode it, so if i encode the number then compare it to the value in the database, it never matches (even though the decoded values are the same)

Would anyone recommend a better way to do this? I could select all numbers, decode them, and compare, but seems like there might be a better way.
#2

[eluser]echoDreamz[/eluser]
First, you may want to contact your payment processor / VISA etc. to see the requirements for encryption on CC numbers as I do not believe codeigniters library meets those.
#3

[eluser]GeXus[/eluser]
Yeah, the encoding is fine...
#4

[eluser]echoDreamz[/eluser]
[quote author="GeXus" date="1284788456"]Yeah, the encoding is fine...[/quote]

Well not just the encoding, your server etc. have to meet PCI requirements etc. I just went through this with VISA and AMEX for a clothing ecommerce site I did, the built in codeigniter encryption was not to their standards.
#5

[eluser]echoDreamz[/eluser]
Also the encrypted values hash should properly decrypt to the original string assuming you dont change the salt key used to make the original hash it should decode it back without issue.




Theme © iAndrew 2016 - Forum software by © MyBB