Crypt::AppleTwoFish - two Apple iTMS/iTunes key descrambling algorithms


Crypt-AppleTwoFish documentation  | view source Contained in the Crypt-AppleTwoFish distribution.

Index


NAME

Top

Crypt::AppleTwoFish -- two Apple iTMS/iTunes key descrambling algorithms

DESCRIPTION

Top

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

The second algorithm is more standard encryption using S-box type permutations and lookup tables, and might have started out something like Twofish or Blowfish.

SYNOPSIS

Top

    for iTMS usages:

    use Crypt::AppleTwoFish;

    my $scrambled_key = '=sixteen uchars=';

    my $apple_twofish = new Crypt::AppleTwoFish(key => $scrambled_key);

    my $descrambled_key = $apple_twofish->decrypted_for_iTMS;

    my $descrambled_another_way = $apple_twofish->decrypted_for_DRMS;




    ..and for iTunes 7 compatible usages:

    Functions cloned from lower level compiled code which was likely intended
    to be difficult to reconstruct cannot easily be given sensible names. Ada 
    Pro is good, but dull.  We chose to be amused during the tedium by coming 
    up with function names from a vegetable farm. 

    For actual usage, see also:

iTunes::Sid.

METHODS

Top

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.

key
    Get/set initial key.

int_table
    Get/set veggie integer table.

byte_table
    Get/set veggie byte table.

veggie
    Get/set veggie.

hwID
    Get/set hardware ID (MAC address or other machine based data). 6 bytes.

keyID
    Get/set key ID.  4 bytes.

userID
    Get/set user ID.  4 bytes.

plant_veggies
    Key munging, spring season

harvest_veggies
    Key munging, harvest season

AUTHOR

Top

   iTMS decrambler adapted from FairKeys 0.5, by Jon Lech Johansen, and from 
   the alterate scramble table found by FutureProof. 

   Veggie Tales algorithm courtesy of Ada and other anonymous pros :-).

SUPPORT

Top

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

COPYRIGHT

Top


Crypt-AppleTwoFish documentation  | view source Contained in the Crypt-AppleTwoFish distribution.