Re: Encryption failing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008. 01. 17, csütörtök keltezéssel 12.14-kor Ken Kixmoeller -- reply to
ken@xxxxxxxxxxxxxx ezt írta:
> (forgot to copy the list)
> 
> On Jan 16, 2008, at 5:08 PM, Richard Lynch wrote:
> 
> 
> > Is it possible that 4% of the time, you have spaces on the start/end
> > of the string, which get trimmed before encryption?
> >
> 
> In this case, no. In trying to simplify the situation to narrow the  
> possibilities of error, I am generating "random" character strings of  
> only alphanumeric (or numeric-only) characters. Each is exactly 16  
> characters.
> 
> 
> 
> > And if rijndael is one of the algorithms which requires a fixed-size
> > input, that also would be "bad" to trim it.
> >
> 
> No documentation that I was able to find suggests that requirement.
> 
> 
> 
> 
> > Actually, I'd suggest that the encryption function has no business
> > trimming the text anyway.
> >
> 
> Philosophically I agree with you, but mCrypt has this nasty habit of  
> appending bunches of nulls to the decrypted string. So philosophical  
> purity gives way to practical application.


yeah, I just ran into the same thing yesterday evening with mcrypt and
rijndael_256.
encrypting went fine, decrypted string had a lot of nulls at the end. so
I too had to use trim() on it.

greets
Zoltán Németh

> 
> Good ideas, as usual. Thank you.
> 
> Ken
> 
> 

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux