Hi Garth, thank you for you quick reply. I think I've sold it. Perl is using PKCS5 as its standard padding(default), which, according to some posts on the net, will not cause problems with PKCS7, so that wasn't the root of my problem. The solution lies in cofiguring perl script with extra parameter "literal_key" and now everything works fine. D