On Mon Mar 14 05:41:02 2016, APPEL wrote:
Show quoted text> Hm. Do you think the problem comes from Crypt-ECB? I just ran a "make
> test" for your module using Crypt-ECB-1.45. Then the same with a
> patched version and using Crypt-ECB-2.10. Both versions pass the test
> suite, and in both versions "decrypt" and "encrypt" from Cryptor.pm
> return the same values. Please let me know if and how I can help you!
Weird. It seems the behavior is different in Crypt::ECB w.r.t. decrypting. The old way "looks wrong", but does actually work successfully with the Pandora API. I wrote a script testing out the old and new code and gave results below. Notice how the decrypted value is different in Crypt::ECB 1.45, but that is actually working with my Pandora account.
#!/usr/bin/perl
use strict;
use warnings;
use WebService::Pandora::Cryptor;
use Data::Dumper;
# taken from iOS partner
my $decryption_key = '20zE1E47BE57$51';
my $encryption_key = '721^26xE22776';
my $cryptor = WebService::Pandora::Cryptor->new( encryption_key => $encryption_key,
decryption_key => $decryption_key );
my $str = "meow mix";
my $encrypted_hex = $cryptor->encrypt( $str );
my $decrypted_hex = $cryptor->decrypt( $encrypted_hex );
print "Crypt::ECB version: $Crypt::ECB::VERSION\n";
print "str: $str\n";
print "encrypted: $encrypted_hex\n";
print "decrypted: $decrypted_hex\n";
belthasar:WebService-Pandora mrmccrac$ perl -Ilib ~/cryptor.pl
Crypt::ECB version: 2.10
str: meow mix
encrypted: 529a4ad30540c7ea5206166bc674e507
decrypted: meow mix
belthasar:WebService-Pandora-0.3 mrmccrac$ perl -Ilib ~/cryptor.pl
Crypt::ECB version: 1.45
str: meow mix
encrypted: 529a4ad30540c7ea5206166bc674e507
decrypted: Y�F�1��