Reply to How exactly does mcrypt implement rijndael-256 and how to make compatible

Your name:

Reply:


Posted by Jens Mόller on 09/22/06 07:10

Hello,

I try to program a Rijndael encryption in Windows which has to be
compatible with php.

In php I use the code below to encrypt with a 256 Bit Key and a 256 Bit
block cipher.
My windows code has the same specs, but the outcome is different.

So far I use no iv to facilitate.

I want to get more information on mcrypt_generic - how is the data
padded to multiples of 32 - my code adds Ascii 0.
I read somewhere on the internet that mcrypt added not ascii 0 but the
ascii value of the number of the padded bytes - still with this
modification of my code the result is different.

Where is the information about the length of the encoded string stored?
My code uses the first 4 bytes (but even if I do not store the length,
the outcome is different).

If no detailed information about mcrypt is available, I would be helped
if I could find a pute php Rijndael implementation so that I can adjust
it to work with my windows code. Is such an implementation available?

Thanks a lot,
Jens


$key = 'Key';
$string = 'Plain text';
$td = mcrypt_module_open('rijndael-256', '', 'cbc', '');
$iv_size = mcrypt_enc_get_iv_size($td);
$iv = str_repeat(chr(0), $iv_size);
if (mcrypt_generic_init($td, $key, $iv) != -1) {
$c_t = mcrypt_generic($td, $string);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
}

[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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация