FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » problem encrypting data (AES_ENCRYPT/AES_DECRYPT)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) [message #181758 is a reply to message #181757] Thu, 30 May 2013 07:46 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Wed, 29 May 2013 23:28:32 -0700, ViVi wrote:


> I've not been able to track down WHEN it fails, but some strings
> everytime fail, other strings are OK.

How long are the strings that fail - I seem to recall that aes works on
128 bit chunks - so multiples of 16 bytes.

One padding scheme I have seen uses n digits of hex character n as
padding, with 16 wrapping to 0, so for example if the data is a multiple
of 16 bytes, the last 16 bytes are 0, but then if the length of the data
mod 16 is:

1 - 15 * f
2 - 14 * e
............
15 - 1 * 1
0 - 16 * 0

Then after you decrypt, remove the padding chars, given that the last
char tells you how much padding there is.

> OK are .... almost all the following string doppio " apice FAILS
> everytime.
> I've tried defining the DB field (catName) VARCHAR or BINARY to no
> avail.

Also, there's a suggestion elsewhere that I googled that the sql data
field should be varbinary or blob. Is it possible that your encrypted
data is longer than your fixed width field, or in some cases not
compatible with varchar?

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: I am having some difficulties with Tooltip...
Next Topic: bug in is_numeric
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 08:15:26 GMT 2024

Total time taken to generate the page: 0.03358 seconds