Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

aes_encrypt aes_decrypt problem

Status
Not open for further replies.

schizoman

Programmer
Apr 17, 2006
4
US
This is really weird. I'm using PHP 4 with mySQL. I'm using aes_encrypt and _decrypt to store customer information as securely as possible. The problem crops up when I go to store (or retrieve -- I'm not sure which) the state that the customer lives in.

AL works for Alabama
GA works for Georgia
fl works for Florida
FL returns an empty string.

Does anyone have any ideas on what's happening here? Thanks.
 
Presumably you're looking at a case-sensitivity issue here. When you encrypt "fl" you would get an entirely different result than when you encrypt "FL".
 
Well, yeah, that's true. But why would "FL" (encrypted then decrypted) not work, while others (case sensitive -- upper case) do? Thanks.
 
Maybe it was originally stored as "fl" when the others were stored in uppercase.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top