use Mcrypt; my $key = 'test-math' . "\0" x 7; # Must be in blocks of 16, null padded my $plaintext = "test-math" . "\0" x 23; # Must be in blocks of 32, null 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();