in reply to same encrypt word ?
Okay, had zero luck making Crypt::MCrypt behave, and could not convince Crypt::Rijndael to do anything but RIJNDAEL-128. But after much casting about, success with Mcrypt:
use Mcrypt; my $key = 'test-math' . "\0" x 7; # Must be in blocks of 16, nul +l padded my $plaintext = "test-math" . "\0" x 23; # Must be in blocks of 32, n +ull padded my $td = Mcrypt->new( algorithm => 'rijndael-256', mode => 'ecb' ); $td->init($key, ' 'x32); # Second parameter is discarded, but warns +without my $encrypted = $td->encrypt($plaintext); print unpack('H*', $encrypted), $/; $td->end();
It prints the glorious output that matches what you're getting in PHP:
c2dbe4b6fec504f3249e2866dacc2a000964136de054865d407321433c001f98
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: same encrypt word ?
by docofchaos (Novice) on Oct 30, 2014 at 15:24 UTC |