Crypt::AppleTwoFish -- an Apple iTMS internal key descrambling algorithm
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.
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;
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.
Returns the unscrambled key for use with the Apple Music Store.
Returns the unscrambled key for use with iTunes/iPod DRM.
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>.
Questions, feature requests and bug reports should go to <wherrera@skylightview.com>.
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:
You forgot a '=back' before '=head1'
To install Crypt::AppleTwoFish, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::AppleTwoFish
CPAN shell
perl -MCPAN -e shell install Crypt::AppleTwoFish
For more information on module installation, please visit the detailed CPAN module installation guide.