What version of mysql are you using? IIRC, there is support for AES in newer 
(4+?) versions. If I were you, I'd handle are the encryption and decryption 
in the database, if possible.

Yep, http://www.mysql.com/doc/en/Encryption_functions.html


On Tuesday 23 March 2004 02:04 pm, Jay Blanchard wrote:
> Good afternoon!
>
> I am storing some encrypted data using PHP to do the encryption and a MySQL
> database. I have encountered a couple of times where I get back a query
> sytax error.
>
> INSERT INTO `test`.`tblEncTest` (`encAlg`, `encMode`, `encIV`, `reqName`,
> `reqSSN`, `reqEMail`) VALUES ( 'blowfish', 'cbc', 'â3IÂÂ}ÃÃ', 'Ã ÃpÃ_9',
> 'âËkÃÂfÃÃ?QÂÃgÃÂ', '-â%ÂÂ+AÂÅÂÃR'âHXâÃÃÃppT ÃÃÃ7 
> GHÂÅÅÃÃÃ' )
>
> You have an error in your SQL syntax near 'HXâÃÃÃppT ÃÃÃ7 GHÂÅÅÃÃÃ' ) '
> at line 1
>
> Now, if you look closely you can see and additional single quote in
> ÃR'âHXâ. I cannot use addslashes() here can I? Or should I base64_encode
> each item and then decode on the way back out. Any thoughts would be
> appreciated.
>
> TVMIA!

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"Only the other day, historically speaking, the 'holy inquisition' burned or 
silenced scientists. The discovery of the microscope and telescope, for 
instance, was delayed for a long time because the inventor, in fear of 
priestly persecution, was afraid to write his scientific discoveries in plain 
language. He had to write them in cipher- a fact discovered only a few years 
ago. Those afflicted with diseases can easily realize where our science in 
general, and medical science in particular, might be today if not for the 
holy zeal of powerful enemies of science who vehemently and ruthlessly 
sponsored ignorance, old s.r, and so disease."

-Alfred Korzybski

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to