WebService::Pandora::Cryptor - Encryption/Decryption for Pandora API
use WebService::Pandora::Cryptor; $cryptor = WebService::Pandora::Cryptor->new( encryption_key => 'key', decryption_key => 'key' ); $encrypted = $cryptor->encrypt( "string" ); $decrypted = $cryptor->decrypt( $encrypted );
WebService::Pandora::Cryptor is used to encrypt and decrypt the data sent to and from the Pandora JSON API. Some methods require the JSON to be sent using the Blowfish algorithm in ECB mode. Some of the attributes returned by the API are encrypted and thus need to be decrypted to read. Each WebService::Pandora::Partner uses a different key for encryption and decryption. If the WebService::Pandora::Method object is passed a true value for the encrypt boolean, it uses this module to do so for the submitted JSON data.
Creates a WebService::Pandora::Cryptor object with the arguments given. The encryption_key and decryption_key options are both required.
$cryptor = WebService::Pandora::Cryptor->new( encryption_key => 'key', decryption_key => 'key' );
Returns a Blowfish ECB hex encrypted string of the JSON data given that the Pandora API expects, using the provided encryption_key specified in the constructor.
$encrypted = $cryptor->encrypt( $json_str );
Returns the decrypted string, given a hex encrypted Blowfish ECB string, that the Pandora JSON API may send. Uses the decryption_key specified in the constructor.
$decrypted = $cryptor->decrypt( $encrypted );
WebService::Pandora WebService::Pandora::Method Crypt::ECB Crypt::Blowfish
Mitch McCracken <mrmccrac@gmail.com>
To install WebService::Pandora, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Pandora
CPAN shell
perl -MCPAN -e shell install WebService::Pandora
For more information on module installation, please visit the detailed CPAN module installation guide.