Okay, this algorithm requires both the key and the data to be in blocks of 16. So you may be running into differences in the way they're being automatically padded for you.
If you set both the plain text and the key to "1234567890123456", you'll see it's encrypted as: "757ccd0cdc5c90eadbeeecf638dd0000". You can verify this yourself by using this online tool.
use Crypt::Rijndael;
my $plaintext = my $key = '1234567890123456';
my $cipher = Crypt::Rijndael->new( $key, Crypt::Rijndael::MODE_ECB );
my $encrypted = $cipher->encrypt($plaintext);
printf "%02x", ord $_ for split //, $encrypted;
Prints: 757ccd0cdc5c90eadbeeecf638dd0000. So hopefully that's what you're getting with your PHP as well.
Update: Ah, I see that all the above was done using 128-bit ECB, and you're using 256-bit.. hmmm.
By the way, Crypt::Rijndael says in no uncertain terms that ECB should be avoided |