#To strip any padding after decryption: my $plaintext = $cipher->decrypt($encrypted); $plaintext =~ s/^\0+//;