Slashdot Mirror


Descrambling CSS w/ 7 Lines Of Perl A DMCA Violation?

An Anonymous Coward, who wears a Camel on his shirt, asks: "Dr. David Touretzky has done it again, posting a 7-line 526-byte Perl VOB descrambler on his ever-growing Gallery of CSS Descramblers. 'qrpff' was written by MIT Student Information Processing Board members Keith Winstein and Marc Horowitz for a 6-hour seminar on 'Decrypting DVD' taught at MIT in January-February. Did those guys violate the DMCA by teaching the class?" Click below for the script, which is among the most obscure pieces of code I've ever seen. For something so small, this is quite an accomplishment. It's also a bit of an embarassment for Hollywood when you consider that the basis of a multi-billion dollar revenue-stream can be foiled by such a small piece of code!

Here's the script:

$_='while(read+STDIN,$_,2048){$a=29;$c=142;if((@a=unx"C*",$_)[20]&48){$h=5;
$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$d=
unxV,xb25,$_;$b=73;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=($t=255)&($d
>>12^$d>>4^$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9
,$_=(map{$_%16or$t^=$c^=($m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t
^=(72,@z=(64,72,$a^=12*($_%16-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271))
[$_]^(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval

A rewrite, using an extra five bytes (!) of perl code, caches a table, which apparently makes the program fast enough to decode a movie in realtime:

$_='while(read+STDIN,$_,2048){$a=29;$b=73;$c=142;$t=255;@t=map{$_%16or$t^=$c^=(
$m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t^=(72,@z=(64,72,$a^=12*($_%16
-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271);if((@a=unx"C*",$_)[20]&48){$h
=5;$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$
d=unxV,xb25,$_;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=$t&($d>>12^$d>>4^
$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9,$_=$t[$_]^
(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval

As Touretzky writes on his Gallery page, typical usage is just: cat /mnt/dvd/VOB_FILE_NAME | qrpff 153 2 8 105 225 | extract_mpeg2 | mpeg2dec -

10 of 270 comments (clear)

  1. Re:CSS Encoder? by Anonymous Coward · · Score: 5

    On second thought, you should email professor Touretzky with this suggestion. He could encrypt one of his copyrighted works and place it on a page at the site and let people know that DeCSS is necessary for them to read his words. On the other hand, this emphasizes the functional aspect of DeCSS which is different from Touretzky's focus. It would allow him to sue (under the DMCA) anyone who trafficked in (or now I think it's even possesses) a circumvention device, such as the courts have determined DeCSS to be. He could sue himself! If he placed his words on a DVD and encrypted using CSS, could he sue the DVD makers for trafficking in a circumvention device -- a DVD player. He could license his DVD as not being allowed (under his authority as a copyright holder) to be used in any DVD player with built-in CSS decryption. Then the DVD makers would be violating the DMCA vis a vis Toretzky's authority as a copyright holder.

  2. For the love of coding! by Pedro+Picasso · · Score: 5
    Please, people. This sort of rampant display of the idiocy of the DMCA (pdf) is fun, but it's not going to help much. What we need is real action. 2600 has already shown that the MPAA has links posted to the code their fighting against (thought the Disney online search engine). This sort of rampant proliferation is cute, but it's not producing results.

    Things that actually help:

    1. OpenDVD - actually learn about the DMCA and the case against it.
    2. Electronic Frontier Foundation - donate to the actual court case
    3. US Congress - Hand write your representatives and inform them of your digust with this law
    Don't get me wrong. Sig files are fun and using this tiny piece of code in every post might help, but this situation isn't going to get better unless we put some real work into it.
    -the Pedro Picasso

    (sourceCode==freeSpeech)

    --

    1. Re:For the love of coding! by dillon_rinker · · Score: 5

      Dear Congress Critter (insert name here):

      Under current law, you are in illegal possession of a copyright protection circumvention device (see attachment). Under the Freedom of Information Act, I demand that you retain this information and make it available to me. However, under the DMCA, I demand that you initiate impeachment proceedings against yourself for your flagrant violation of the law in receiving the attached piece of paper.

      Yours truly,

      (insert name here)

  3. CSS Encoder? by grahamm · · Score: 5

    Has anyone ever published a CSS encoder? Then people could encode their documents/articles/emails etc with this and distribute DeCSS as the mechanism for accessing the information. This usage should not fall foul of DCMA as it is being distributed by the owner of of the copyright material (you) to enable access. MPAA did not patent CSS, so can they prevent anyone from using the algorithm to "protect" their own copyright material?

  4. and the useless use of 'cat' goes to.... by orabidoo · · Score: 5

    slashdot, for the command line at the end of the example.

  5. Is this one actually illegal? by dschuetz · · Score: 5
    It looks like this won't automagically decode "any" DVD, but requires you to know the key first. Therefore, without a specific key given to you by the content providers, you're not actually able to decode the content. Does that mean that this script actually is not in violation of DMCA or other such MPAA devices? It's not actually a "circumvention" device, it's the actual decryption device, that requires secret keys to operate.

    Once you write brute-force wrapper around it to bludgeon out keys, or something to derive a title key from a disk key, utilizing secrets stolen by illegally reverse-engineering other stuff, then are you violating MPAA plans?

  6. Anyone notice this little bit of the code? by HuvahCraftah · · Score: 5

    >8^(

    I think that's a portrait of the people at the MPAA.

  7. .sig!! Yay!! by Noryungi · · Score: 5

    Let's have fun, ladies and gentlement!!

    We should all add this snippet of code to our .sigs and use it everyday for every form of electronic communication: Slashdot postings, Usenet, email, you name it!!

    Then stand back and watch as lawyers for the DVD Association go crazy, trying to sue everyone! Even better than linking! =)

    The DeCSS case will be won, not in the court, but over the Internet -- so fire up that editor today... ROFL

    --
    The right to offend is far more important than the right not to be offended. (Rowan Atkinson)
  8. Terse by pallex · · Score: 5

    Perl has got to be the only language where its actually more readable when compiled and then disassembled!

  9. erm by fjordboy · · Score: 5

    if it was a violation, I am sure posting the script on /. is as well. :) This will make for a much better "Got DeCSS" shirt, because it will actually all fit on the shirt.