Problem with ODBC driver


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Robert G Laurin on March 03, 2010 at 09:12:29:

After hours of digging and testing, I've finally nailed it.

I am using a MySQL server to encrypt sensitive credit card information. Been testing the write a little while back (that's when Brian kindly added the silent option to the ODBCDRV).

What I found now, is that when I try to read decrypted information, the results come in not as expected. Columns are offset and some are missing.

The cause seems to be the UNDERSCORE character used in the command syntax of AES_DECRYPT()

So, this command:

SELECT custid,AES_DECRYPT(ccaccount,'..{32 chars encryption key} ..'),AES_DECRYPT(ccaccname,'..{32 chars encryption key} ..') from mysafeccdatabase WHERE custid='123456';

Would return (separated by '|'):
123456| | 5412345678901239

I originally suspected the comma ',' in the command but doing a SELECT LEFT(myfield,10) returned the proper value.

I confirm this by creating a FUNCTION on the mySQL server that I called MYAESDECRYT:

SELECT custid,MYAESDECRYPT(ccaccount,'..{32 chars encryption key} ..'),MYAESDECRYPT(ccaccname,'..{32 chars encryption key} ..') from mysafeccdatabase WHERE custid='123456';

Returned (separated by '|'):
123456| 5412345678901239 | Jane Doe

I also noted that result of various functions seems to be prefixed with a space ' '.

Took me a while to figure out this one. I even tried the ODBC trace. Interesting but it did not show the data - just the headers.

I would love to try this code without ODBC and using the new SQL driver in 2010, but I am waiting for the new installation for 2010.411 - current one gives an error at 32% of install.

Did I read correctly that the 2010's SQL driver will work with Comet 16 ?



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]