The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Acme::DRM - Library providing cryptographic capabilities especially suited for Digital Rights Management. Protects against Pirates. May increase global warming. Note: Not guaranteed to protect against Pirates or increase global warming.


Version 0.03


 use Acme::DRM qw(secureXOR doubleROT128);
 my $intellectualProperty = 'One-hit Wonder Music';

 # Encrypt your IP to plug the digital hole
 my $encryptedContent = secureXOR($intellectualProperty);

 # Invoke the DMCA by encrypting your data, without invoking 
 # additional overhead for decryption at runtime
 my $protectedContent = doubleROT128($intellectualProperty);





XOR is an extremely convenient method for encrypting a digital media stream. Given any two of the a) original data, b) encryption key, and c) encrypted data, you get the third item. Unfortunately, hackers have compromised the effectiveness of this computationally convenient method. The weakness is the reuse of a single key. The answer is to use a variable key, however, key distribution becomes a difficult proposition. If the key is distributed in the clear, pirates can simply decrypt the digital media stream, and steal your Intellectual Property. Our solution is to use the media itself as the key. This function conveniently takes only the media as a single argument, and automatically XORs the datastream with a copy of itself, rendering the stream almost completely unrecoverable without the key: the media itself. This is virtually hacker-proof, except for one exception: the encrypted datastream is exactly the same length as the original data, but this is almost never probably a weakness. This algorithm does guarantee that your original data will not be recoverable from the encrypted stream without the proper key. Additionally, use of an incorrect key will not provide hackers with any sort of clue that they have guessed an incorrect key.


This function exists to provide a method by which you can protect your Intellectual Property under the DMCA, without imposing the difficulty of implementing a separate, potentially insecure decryption algorithm in your secure media playback application. Simply pass your digital media to this function, and it will output an encrypted stream, conveniently passed twice internally through a strong ROT-128 encryption algorithm. The resulting encrypted content cannot be legally decrypted by a hacker, since you encrypted it to protect it from hackers and pirates. Further, you can pass the content through this algorithm multiple times for enhanced protection. Decryption can be performed by either passing the encrypted datastream back through this algorithm, or in many cases, the encrypted stream itself can be used by the playback function.


Brett T. Warden, <>


Please report any bugs or feature requests to, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


Thanks to the lobbyists behind the DMCA and the politicians who bought (or were bought) into the great idea of assigning corporate greed higher value than constitutionally-asserted citizen rights.


Copyright 2005-2007 Brett T. Warden, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.