The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Crypt::AppleTwoFish -- an Apple iTMS internal key descrambling algorithm

DESCRIPTION

This code appears to have only cursory resemblance to Bruce Schneier's blowfish and twofish algorithms in that it too has a table-based decoder.

Derivation from FairKeys code by Jon Lech Johanson and others at nanocrew.net. If you don't know what that is, don't bother looking here further. This is a Pure Perl implementation. I doubt there is any need for xs coding for what would mainly be processing 16 bytes at a time.

SYNOPSIS

    use Crypt::AppleTwoFish;
    
    my $scrambled_key = '=sixteen uchars=';
    
    my $apple_twofish = new Crypt::AppleTwoFish($scrambled_key);
    
    my $descrambled_key = $apple_twofish->decrypted_for_iTMS;
    
    my $descrambled_another_way = $apple_twofish->decrypted_for_DRMS;
    

METHODS

new

Call with the key as a scalar argument. When passed (LWP simulating iTunes) over iTMS, encrypted M4P keys for your purchased music are currently 16 unsigned chars in length.

decrypted_for_iTMS

Returns the unscrambled key for use with the Apple Music Store.

decrypted_for_DRMS

Returns the unscrambled key for use with iTunes/iPod DRM.

AUTHOR

   From the scramble function and scramble_vector adapted from iTMS.cs, FairKeys 0.5, 
   by Jon Lech Johansen, but derived from the alterate scramble table found by 
   FutureProof. Perl version: William Herrera B<wherrera@skylightview.com>. 

SUPPORT

Questions, feature requests and bug reports should go to <wherrera@skylightview.com>.

COPYRIGHT

    Copyright (c) 2005 William Herrera. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 629:

You forgot a '=back' before '=head1'