The module expects the key to be in bytes, not in hexadecimal nibbles:
use strict; use Crypt::ECB qw(encrypt decrypt encrypt_hex decrypt_hex); my $ascii_key = "0123456789abcdef"; my $key= "\x01\x23\x45\x67\x89\xab\xcd\xef"; my $plain_text = "Now is the time for all "; my $expected= '3fa40e8a984d48156a271787ab8883f9893d51ec4b563b53'; my $result= encrypt_hex($key,"DES_PP",$plain_text,0); if( $result eq $expected ) { print "Yay\n"; } else { print "Got : $result\n"; print "Expected: $expected\n"; };
In reply to Re: DES ECB mode using DES_PP
by Corion
in thread DES ECB mode using DES_PP
by v4169sgr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |