#!/usr/bin/perl -w use strict; use Crypt::Rijndael; use Crypt::CBC; use Convert::Base64; my $encodedString = 'AI8Xv81IsklU/SLZDV8sW4EqUWKh4yiOm/y0WE5PPmXrciz1NyP3zDzirY1vq0/2wPD0m8ZlTHeGL4Cpygs7/CJAS9pyEz47/Apnn5qix45YpH7m2OXxug/04UyuOFnH'; my @keyArray = (231, 216, 3, 26, 247, 91, 73, 223, 222, 174, 20, 122, 30, 27, 240, 211, 219, 51, 217, 212, 22, 94, 219, 239, 147, 12, 164, 230, 73, 168, 72, 247); my @ivArray = (222, 174, 20, 122, 30, 27, 240, 211, 95, 191, 236, 203, 64, 122, 254, 71); my $key = CreateString(@keyArray); my $initVector = CreateString(@ivArray); my $decryptedString = Encode::decode("UTF-16LE",Decrypt($encodedString, $key, $initVector)); print $decryptedString; sub Decrypt { my $encodedString = shift; my $key = shift; my $initVector = shift; my $base64String = DecodeBase64ToString($encodedString); my $cipher = Crypt::CBC->new( { key => $key, #The encryption/decryption key (required) cipher => 'Rijndael', #The cipher algorithm (defaults to Crypt::DES), or a preexisting cipher object. iv => $initVector, #The initialization vector (IV) header => 'none', #What type of header to prepend to ciphertext. One of 'salt' -- use OpenSSL-compatible salted header 'randomiv' -- Randomiv-compatible "RandomIV" header 'none' -- prepend no header at all padding => 'standard', #The padding method, one of "standard" (default), "space", "oneandzeroes", "rijndael_compat", "null", or "none" (default "standard"). literal_key => 1, #If true, the key provided by "key" is used directly for encryption/decryption. Otherwise the actual key used will be a hash of the provided key. (default false) pcbc => 0, #Whether to use the PCBC chaining algorithm rather than the standard CBC algorithm (default false) keysize => 32, #Force the cipher keysize to the indicated number of bytes. blocksize => 16 #Force the cipher blocksize to the indicated number of bytes. } ); return $cipher->decrypt($base64String); } sub DecodeBase64ToString { my $encodedString = shift; return decode_base64($encodedString); } sub CreateString { my @array = @_; my @chars = (); foreach my $value (@array) { push(@chars, chr($value)); } return join('', @chars); }