Skip Menu |

This queue is for tickets about the Crypt-ECB CPAN distribution.

Report information
The Basics
Id: 8922
Status: resolved
Priority: 0/
Queue: Crypt-ECB

People
Owner: Nobody in particular
Requestors: dannyavni [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: PADDING_AUTO seems broken
The sample code will encrypt a string and than decrypt it using the same key, the outcome is truncated - as if padding was not applied. It happens when the last character in the string is the "0" (zero) character. use strict; use Crypt::ECB; my $key=pack("H16","12345678"); my $cipher = Crypt::ECB->new; $cipher->padding(PADDING_AUTO); $cipher->cipher("DES") || die $cipher->errstring; $cipher->key($key); my $plaintext_id = "17108154291234550"; my $crypted_id = $cipher->encrypt($plaintext_id); my $decrypted_id = $cipher->decrypt($crypted_id); print $decrypted_id,"\n"; print $plaintext_id,"\n";
Problem fixed. New version 1.2 uploaded to CPAN.