Reply to Re: Making Perl Crypt::CBC work with PHP mcrypt_cbc()

Your name:

Reply:


Posted by josh.kuo@gmail.com on 06/03/06 17:54

Answer my own question...

The perl Crypt::CBC documentation states that the '-regenerate_key' and
'-prepent_iv' are deprecated, that's why I used '-literal_key' instead
of '-regenerate_key'.

However, when I switch back to use the old '-regenerate_key', I got a
different error:

If specified by -literal_key, then the key length must be equal to the
chosen cipher's key length of 56 bytes at ./blow.pl line 9

So I changed my key to something like this in both perl and PHP:

my $long_key = "01234567890123456789012345678901234567890123456789"
my $key = substr($long_key, 0, 56);

And while decrypting on the PHP end, I needed to use rtrim() on the
decrypted string.

After these changes everything is working.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация