Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

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

Posted by Cliff on Wed Mar 07, 2001 06:54 AM
from the this-is-just-too-funny dept.
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 -

+ -
story
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • by Anonymous Coward
    The point is that the DMCA is blatantly unconstitutional (as interpreted by the courts [so far]). But the courts unconstituional interpretation doesn't mean that we have to sit back and pretend the king has clothes. So, we ask, again and again, is this a violation, is this a violation, to point out that these violations of the DMCA happen also to be speech, which proves the point: the DMCA (as interpreted by the courts) is Unconstitutional (it violates the first amendment).
  • You're absolutely right. Writing the "freshmen" first is a good idea. They don't have quite as much of a postal backlog anyway. I read that letter, too, and was pretty heartened by it.

    The way Congress works, most of the people who voted for that bill never looked at it. It was a bi-partisan initiative with strong financial backing. The committee that recommended it considered that it would be another limit on fair use, but they probably never considered its effect on programmers and its conflict with the First Amendment. I tend to think they were looking at a law with powerful backers and few visible enemies and voted the way they thought would make them look good and help the country. Who would vote against a flashy name like Digital Millenium Copyright Act?
    -the Pedro Picasso

    (sourceCode == freeSpeech) [x-omega.com]

    --

  • Art isn't necessarily beauty. I've gotten into too many arguements about this to just let it go. You will find as many different interpretations of what art is as you will find artists you actually appreciate.

    Mine:Art is a human expression meant to evoke an emotional response.

    I'm not right, really, but neither are you. I would say most code isn't art. I would also say code can be art. After all it is only a set of choppy written instructions. Are recipies art? Is command based haiku art? Is this post art?
    (Answers: yes, yes, no)

    -the Pedro Picasso

    --

  • A good point. A fun example I like to use is the fact that nowadays (love that word) people have to study Shakespeare for a while before they get his sex jokes fart jokes and really bad puns. Look at the Sampson and Gregory conversation that kicks off Romeo and Juliet [ibiblio.org] (after the prologue). It's funny as heck, but you really have to know what colliars, a cholers, and a collars are. It's art, but only to those who understand. To everybody else, it's Elizabethan gibberish... or Perl, depending.

    --
  • The program itself is pretty awesome, but even more so is his use of -w. Now that takes guts.
  • It was on the BBC's web site, etc., a few weeks ago. The law was just passed, though presumably hasn't taken effect yet. The recording racket and friends wanted a tougher law, which made sharing files with strangers a crime, but didn't get it.
  • I found placing the code snippet in various email program's X-headers works great too.

    With a little work, a mail program could enocde this work of art uuencoded into the Message-ID header. Why? When anyone replies or forwards your email, they will resend your CSS code!

    X-Comment: ALL YOUR BASE ARE BELONG TO US
  • He couldn't sue himself under the DMCA any more than he could sue himself under copyright law for copying his own works.

    He could try suing DVD makers, but he'd have a hell of a time getting it through court. You see, if he encrypted his DVD with CSS and his own key, then commercial DVD players wouldn't decrypt it. If he encrypted his DVD with CSS and at least one of *their keys*, then he'd have a hard time convincing a judge that the key choice wasn't implicit consent for them to perform decryption.
  • 2^40 is what, one trillion? But there's a couple hundred DVD player keys, so only a few billion files need be generated before a legally useful one is found. So a 1 kilobyte copyrightable file would require just a few terabytes of storage for this workaround... that's not cheap, and I think you'd have a really hard time convincing His Honor that there was any purpose to all this other than pissing off the court.
  • I think there would also be a problem with the fact that some of the DVD players that can decode the text existed *before* the text did!

    Kind of like that prior use thing in patents.

  • Hmm OK So it should read like this...

    The following code is a PERL script capable of decoding an encrypted DVD (necessary to watch a DVD on a Linux machine) in real time. This is illegal to use according to the Digital Millennium Copyright Act, a set of laws passed by anonymous vote in congress in 1998. The MPAA feels that they must stop you from using this code to watch DVD movies because then...

    ...they can't force you to watch the commercials,
    ...they can't charge you more money according to your wealth or region code.

    $_='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])$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,joi n"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/. ..$/1$&/;$d=unxV,xb25,$_;$e=256|(ord$b[4])>8^($f=$ t &($d>>12^$d>>4^$d^$d/8))>8^($t&($g=($q=$e>>14&7^$e )^$q*8^ $q>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a } ';s/x/pack+/g;eval

    If you are interested in learning more about how to create your own DVD decoder you can take the authors class on the subject at MIT http://www.mit.edu/iap/dvd

    END .SIG

    I was kinda hoping to create somthing that could spell out the evils in a tolerable length/readability. Other than manditory commercial viewing and region codes what else does an open source version wreck for the MPAA?

  • you know, if someone did something to "encode" that little perl script, so it ended in say, pig latin, then it wouldn't be functional code anymore, no?

    Then, add a script up at the top of the page, mark it "DMCA Violating PLCPS (Pig Latin Copy Protection Scheme) Script", that nicks off the last two characters... and technically, haven't you protected yourself? Because the only DMCA violation is in fact the De-PLCPS script, no? That other thing is protected under a copy-protection scheme and isn't even usable, therefor, what's there to complain about? Sure, I'm sure the owners of De-PLCPS might take offense to your violation of the DMCA, but then again, that would be THEIR problem, not the DVD-CCA's, no?
  • I'm sorry, but those 7 lines of perl, even as cryptic as they are, sure look a lot simpler to me than the usual DeCSS.c code that's been floating around the net. Whoever wrote the perl code must have done a great job finding the logic behind those tables of numbers. I'm sure that you could turn this perl code back into readable C, and it would be much clearer than the original DeCSS.c. What's more, it'd probably be easier to do it starting from this perl code, than starting with the C code and redoing the work of analyzing the integer tables.
  • ...I've tried to clean up the code a bit, undid the little compression trick they did ('x' == 'pack+'), and still can't make heads or tails of it.

    Would anyone care to explain exactly how this works, in english (or should I just wait until the notes from the seminar are online)?

  • I'm hoping the authors entered this code into the Obfuscated Perl Contest. Then they can claim this code has two uses: descrambling CSS and teaching good programming style through the use of a bad example.
  • Of course you own something when you buy it.

    What proof do you have that you don't? The word of companies like Microsoft with their EULAs and the RIAA and MPAA who try to take away your ability to use the CD/DVD that you own?

    Well, what do you think they'll say? They hope that people will believe them. And they hope they'll do what you did, pass that on to others.

    Their view of copyright is incredibly short sighted. I really don't see why they deserve copyright protection anymore. Seriously. Copyright is a social contract ... a limited monopoly in trade for opening something up for public use.

    The MPAA/RIAA/Software publishers are trying to have the 'limited' part of the monopoly removed, and to take away all your rights to do anything with the work that they don't want you doing.

    They aren't living up to their side of the bargain, thus the contract is void.

    Now, they can claim anything they like, about how you'll join satan, and undermine capitalism, if you violate THEIR rights, but I don't see them saying anything about your rights. And it's not just a case of "well don't buy it." They're counting on your tax dollars funding the legal system which is granting them this unlimited monopoly, so they're taking from you and giving nothing back.

    Anyways, as I see it, their laws are the product of bribery. They lobbied for those laws, which means paying politicians in "campaign funds", then they bribe judges like Kaplan (Dunno if they paid him, or if it was enough that he worked for them before and got paid then) to give weight to their laws. In my view, that's not a valid law. Like a contract for illegal activities isn't a valid contract.

    I choose not to follow those laws. I honor copyright as I see it. Limited monopoly, a guarantee to the author that they'll be the first to profit from their work. I don't see it as a right for the author to control everything I do with their work, so I don't feel obligated to follow laws that they buy which say that.

  • I agree with your assesment of the video media. You buy it, you can use it in any way that doesn't conflict with existing law. (You can't copy and distribute it, and you can't kill someone with it (Britney Spears music...))

    But you're wrong when you say you that you license software...

    They only software you license if something you buy specifically from a contractor, a company that sells you a specific limited site license for a special deal, or shareware.

    In the first case it's because you're paying the contrator for the product. You decide which rights you want and then bargain over the value of those. With the specific site license, that'd be like Adobe selling you 100 copies of Photoshop for an 80% discount because you could show that it was all going to be used in a way that they approved of (to teach people who might later buy their own copy for example) and you were both making concessions in the deal (them price, you in what you can do with it.)

    And finally and most importantly, shareware. If you download a program off of CNET (or anywhere else) there's no payment on your part so you have no right to expect it'll do anything. You then get it and can agree to a contract allowing certain use in trade for certain payment (maybe nothing, maybe a post card, maybe $$..)

    But with commercial software, you buy it at the store and take it home, where you find the 'contract'. At that point, the contract isn't valid. You purchased all required rights to the software already. It's invalid for a number of reasons.

    1) You can't put limits on an existing contract (it becomes a new contract, which requires new agreement and especially, new consideration (compensation)). I can't see you a car and then call up later and say that you have to buy gas from me. I can offer you an exclusive gas contract in trade for something, free tires, a low price, whatever, but it's only an offer until you accept.

    2) The 'contract' in the form of a click-through license attempts to prevent your use of *YOUR* software (you paid for it at this point) by requiring you to agree to their contract. That's duress. You're not bound by agreements made under duress. Simply click 'Yes' and ignore it...

    3) That contract doesn't even offer you anything, just the ability to use your software, so you don't get anything out of it. A contract that doesn't have compensation for both parties isn't valid. Again, click 'Yes' and ignore it.

    Certainly don't take the corps' word on any of this, they stand to gain by making you believe you have more obligations than you really do.
  • by dair (210) on Wednesday March 07 2001, @03:14AM (#379519)
    I'm not sure that it would matter to the courts whether the source code to descramble CSS was composed of 7 lines or 700... What really matters is that the MPAA scrambled the content on their DVDs and this code circumvents that.

    That's an interesting point - on what basis do you draw the line? You could say that "obviously" rot-13 wasn't a serious attempt to control access but if 7 lines of Perl can be considered a circumvention device, then what about 5 lines? Or 3? Or 1?

    I share your scepticism about the outcoming of trying to challenge things on that basis, but you would think there has to be some kind of definition as to how how simple a circumvention device is allowed to be while remaining "effective" (or do they intend every case to be ratified by a court? Wait, don't answer that...).

    Pre-DeCSS, if you'd proposed a circumvention device that could be bypassed in 7 lines of Perl, who would have taken it seriously?

    -dair
  • by Just Jeff (5760) on Wednesday March 07 2001, @05:08AM (#379520) Homepage
    ...only if you've never used APL.
  • by Cardinal Biggles (6685) on Wednesday March 07 2001, @06:21AM (#379521)
    Perhaps it's not encryption. But DMCA isn't about encryption and decryption, it's about copy protection mechanisms. So in theory if they ROT13 a movie and call it their "copy protection", you can't reverse that. Plain silly, but true.

    It doesn't even need to be copy protection, the DMCA talks about access control. CSS doesn't really provide copy protection, but it does do access control.

  • What if the reverse engineering were done overseas, say in (just as an example) Norway

    I didn't mean to say that I agreed with (or conceded to) MPAA's or Xing's (it was a Xing player, right?) shrinkwrap-license-prohibiting-reverse-engineering . I was just trying to point out that some other "agreeably" illegal activity must be engaged in before use of the perl script became actual circumvention of CSS.

    Whether or not what was done to get Xing keys (which, if I recall correctly, is the only part of the "Trade Secret" argument MPAA is using) is illegal shouldn't (IMHO) affect the status of this script.

    Correct me if I'm wrong, but wasn't the entire DeCSS system developed originally? That the only part that was "stolen" was the Xing master key, accidentally left unencrypted in the windows program? So MPAAs argument for trade secret theft only applies to the use of those Xing keys, right? Or could they argue that DeCSS could not have been developed without aid of those keys, and so it's a derivitave work, and so tainted by the theft of the secret?

    And if so, at what point, after analysis, review, scholarly discussion, and seminars, does the CSS algorithm (and various ways to implement it) pass beyond any trade secret protection, again reducing DeCSS to a key availability issue?

  • by Grond (15515) on Wednesday March 07 2001, @07:18AM (#379523)
    Probably redundant, but CSS -does- use keys. Every licensed DVD player has a different key. Admittedly, the key length is short, so it could've been brute-forced, but the real trick was the Xing didn't encrypt (or even obfuscate) their CSS key in their DVD player software. That's what allowed DeCSS to be written in the first place. They key makes up most of the C code version, though, so I'm not sure how the Perl version gets away without using it (apparently...maybe it's buried in there somewhere). Anyway, it also has public keys, I think, in the form of what the DVD itself is encrypted with. The private player keys are the only things that can decrypt it properly. If indeed the perl version doesn't use the key, then that means it's obviously weaker than I suspected.
  • by scruffy (29773) on Wednesday March 07 2001, @04:42AM (#379524)
    No, this is what happens when the space key stops working on your keyboard.
  • by Malcontent (40834) on Wednesday March 07 2001, @08:44PM (#379525)
    Like most americans you seem to be confused as to how the law works. The law does not work the same for everybody. The intent of the DMCA was to make more money for some corporations any other use of that law will not be held up in court.

    The congress critter as well as any other corporation is not answerable to this or any other law only you are. Do you know why? It's because they have more money then you.
  • by mach-5 (73873) on Wednesday March 07 2001, @04:00AM (#379526) Homepage
    Disclaimer: I'm the last person on earth that knows anything about encryption technologies, so I'm just gonna pose a few questions. Talk amongst yourselves, discuss...

    Firstly, I'm sure this has been discussed on /. before, but is CSS really encryption? It seems that it's more of just an encoding/compression scheme. There are no public/private keys envolved. The way that I understand encryption is that if I encrypted the phrase, "All your CSS are belong to us!" it would come out different every time depending on the keys used. This is what makes it private. CSS on the otherhand would just encode the phrase the same way, every time so that anyone's DVD player can decode it. So, I could use CSS to encode my homework and send it to my teacher if I wanted to. The teacher, or anyone intercepting that homework could use DeCSS or this script to unencode it assuming they knew how it was encoded in the first place. If I encrypted it, anyone that intercepted my homework, would have no way to decrypt it, and therefore, steal my answers. The teacher couldn't decrypt it either unless he had the key. Therefore, its not really encryption but more of just an encoding scheme, kind of like "zipping" a file with pkzip, winzip or gzip. Am I correct on this, or at least heading in the right direction?

    If this is the case, then it seems like CSS is more of a standard practice thing, than a proprietary thing, and the MPAA should just give up. I'm sure that "zip" technology was at one time proprietary, now its pretty much standard. And, if I am correct, this really doesn't hold up to the DMCA, because its not encryption that I am trying to circumvent, rather, I am just decoding what I have rightfully purchased.

    If this is the case, I have no problem with the MPAA going after the individuals that are illegally copying DVD's and selling them to their 31337 friends. However, just using the scripts and code to watch a movie on your Linux box is another story entirely, and I have no problem with that.

    Thoughts, comments, bitching???
  • by Scarblac (122480) <slashdot@gerlich.nl> on Wednesday March 07 2001, @02:30AM (#379527) Homepage
    Useless use of cat!!

    Typical usage should be
    qrpff 153 2 8 105 225 /mnt/dvd/VOB_FILE_NAME | extract_mpeg2 | mpeg2_dec -

  • by cyber-vandal (148830) on Wednesday March 07 2001, @03:58AM (#379528) Homepage
    How about a COBOL version - probably the longest DeCSS app yet.
  • by -kyz (225372) on Wednesday March 07 2001, @03:32AM (#379529) Homepage
    I know very little (read: nothing) about Perl but it seems like this is basically compressing that long, ugly, awkward table of values that represents the magical mystery DVD key. Am I correct?

    No, because those tables aren't really needed.

    Most of the tables in css-auth.c are used to work out the title key from the disc key - with this script, you provide the title key on the command line.

    The other tables in css-auth.c are used to reverse the order of bits in a byte - this can easily be accomplished by code instead.
  • by ishark (245915) on Wednesday March 07 2001, @02:24AM (#379530)
    For me this is a fairly clear answer to the question "is programming an art?"

    It definitely is.

    I bow to the superior skill of the author of those 526 bytes. I've saved it even if I don't own a DVD reader (and I don't plan buying one), just to open up the file at times and contemplate it.
    Maybe one day I'll see the light.

  • by Ryan Koppenhaver (322154) on Wednesday March 07 2001, @02:02AM (#379531) Homepage
    The script circumvents access controls, doesn't it? Isn't that what the DMCA makes illegal? This isn't rocket science, folks.

    Next question.
  • by Anonymous Coward on Wednesday March 07 2001, @04:00AM (#379532)

    Has anyone though of writting a virus that
    takes a persons files and encodes them with
    CSS? It would be extremely funny if some MPAA
    lawyer found himself sitting in front of his
    computer and a message pops up

    "Dear user: Your files have been encrypted with CSS. You may trivially decrypt these files with DeCSS unless you live in the United States in which case the use of DeCss could cost you five years in jail and $150,000 file. Have a nice day."

  • by demon (1039) on Wednesday March 07 2001, @04:14AM (#379533)
    CSS is a two-phase procedure - first being the player software (well, that's the DVD CCA's idea) authenticating to the drive (software passes player key to drive, verifies that player key is entitled to access the loaded disc's content), and then, the title keys are used to decrypt the individual streams on the disc.

    Is it a crappy arrangement? You bet. The title keys are 40 bits, and the player keys are (iirc) 80 bits. This is not high encryption here. Once you get past the auth-with-drive part, the title keys are handed over anyway. But simply, yes, it is encryption - from what I've heard from cryptological experts, far from a well-designed system. But it more-or-less does what the DVD CCA intended.
    _____
  • by Helmholtz (2715) on Wednesday March 07 2001, @04:30AM (#379534) Homepage
    Actually if all they cared about was the dollar, we wouldn't be having this mess. There are certainly more long term profits to be made by taking these new digital formats and finding a new and innovative way to make money from them.

    This nonsense of trying to lock everything down and create laws that make viewing your product illegal is not good business. Sure it maintains profit margins for now, but long term will do nothing but cause damage.

    Not to sound exceedingly paranoid here, but this is not so much about money as it is about fear of losing power and face.

    Pride is causing this mess, not greed.

  • by acb (2797) on Wednesday March 07 2001, @05:02AM (#379535) Homepage

    What's more is that USING it to view any legally obtained DVD is not a crime. These things are what allow projects like xine and LiViD to exist with a relative lack of legal molestation.


    xine and LiViD, AFAIK, do not include CSS decryption tools, and can only view unprotected DVDs out of the box. There are CSS patches, but they are in countries without a WIPO law.


    The DMCA itself is strictly an AMERICAN law and has no jurisdiction * anywhere * else in the world.


    True; though it is an implementation of the WIPO copyright treaty (the one everybody was up in arms about a few years ago). The EU and Australia have already criminalised circumvention devices; other nations are in the process of doing so.

    Maybe someone can persuade Gaddafi to set up a data haven in those bombproof bunkers he has. Given the MPAA's panic, disseminating DeCSS may be a better way of attacking the Great Satan America than using it as a chemical weapons plant.
  • by Odinson (4523) on Wednesday March 07 2001, @03:34AM (#379536) Homepage Journal

    I will be appending this with a brief description to my emails. Here is what I had in mind.

    The following code is a PERL script capable of decoding an encrypted DVD (necessary to watch a DVD on a Linux machine) in real time. This is illegal to have according to the Digital Millennium Copyright Act, a set of laws passed by anonymous vote in congress in 1998. The MPAA feels that they must stop you from using this code to watch DVD movies because then...

    ...they can't force you to watch the commercials,
    ...they can't charge you more money according to your wealth or region code.

    $_='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])$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,joi n"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/. ..$/1$&/;$d=unxV,xb25,$_;$e=256|(ord$b[4])>8^($f=$ t &($d>>12^$d>>4^$d^$d/8))>8^($t&($g=($q=$e>>14&7^$e )^$q*8^ $q>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a } ';s/x/pack+/g;eval

    If you are interested in learning more about how to create your own DVD decoder you can take the authors class on the subject at MIT http://www.mit.edu/iap/dvd

  • by mikeCRS (50144) on Wednesday March 07 2001, @05:10AM (#379537) Homepage
    Well.. I tried to paste the unobfuscated version, but unfortunately it is caught by the lameness filter here :(

    Anyway, to unobfuscate it do this:

    First paste the code into your favourite editor and change eval to print
    Then save the file as decss.pl and execute this command in the shell:

    perl decss.pl | perl -MO=Deparse

    Now it's almost readable :-)

    --
  • by kfg (145172) on Wednesday March 07 2001, @04:06AM (#379538)
    Publishing it is a crime because a judge said it was. That's really all it takes. So, you got that one wrong.

    The other thing you got wrong is that *owning* it is NOT a crime! Noone, most particularly neither a judge nor the MPAA have ever suggested that possesion is a crime, and in fact the MPAA ONLY prosecuted those KNOWN to possess it for * distribution *, not possesion.

    What's more is that USING it to view any legally obtained DVD is not a crime. These things are what allow projects like xine and LiViD to exist with a relative lack of legal molestation.

    I've said this a thousand times already, and I'll keep saying it until people get it:

    The ONLY thing that has been ruled to be illegal about DeCSS is its *distribution.*

    *Possesion* of DeCSS is legal, it has been banned neither by a judge nor by the DMCA. If you have obtained a copy of DeCSS YOU are not in violation of the law, only your *source* is.

    USE of DeCSS for viewing legally obtained DVD's is not illegal.

    Any illegality of DeCSS, at the moment, applies strictly only to California and New York State. It is only in these states that courts that have ruled have any jurisdiction.

    The DMCA itself is strictly an AMERICAN law and has no jurisdiction * anywhere * else in the world.

    KFG
  • I believe you can also be sued for debugging Perl code under the DMCA.
  • by Dr. Awktagon (233360) on Wednesday March 07 2001, @06:49AM (#379540) Homepage

    Useless use of cat!!

    Using cat to present on stdin isn't useless! What if, after running your command line, you discovered you had to run it through your special frob script:

    cat /mnt/dvd/VOB_FILE_NAME | frob | qrpff 153 2 8 105 225 | extract_mpeg2 | mpeg2_dec -
    Now if you use < you have to hit up arrow, and do some retyping, cutting and pasting..but with cat you can hit up arrow, move to the right place, and type frob and a pipe!

    cat is your friend..

  • by Prophet of Doom (250947) on Wednesday March 07 2001, @02:31AM (#379541)
    This probably should have been submitted to Ask a Lawyer [utsystem.edu] rather than Slashdot but it is an interesting question.

    I'm not sure that it would matter to the courts whether the source code to descramble CSS was composed of 7 lines or 700, whether it was Perl or C or VB, compiled or binary. The judge probably wouldn't understand any of those details anyway. What really matters is that the MPAA scrambled the content on their DVDs and this code circumvents that. Just because you bought the disc, don't expect to use it in some way in which its owners don't approve. Unfotunately, if the judge could really understand the details of the case I think he would agree with the opinions expressed on Slashdot, so would just about any sensible person who doesn't have some vested intrest in the MPAA's revenue stream.

    The reality is that once the lawyers use the word 'hacker' to describe the people who write code like this, throw in 'circumvent' a few times, and tell everyone that this program will cause their DVD prices to skyrocket, people's heads turn. The facts of the case get lost.

    Anyway, this is a nice accomplishment. 7 lines of Perl that will descramble CSS. Sad that it constitutes a circumvention device, but maybe that will change.

  • by Anonymous Coward on Wednesday March 07 2001, @04:13AM (#379542)
    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.
  • by Pedro Picasso (1727) on Wednesday March 07 2001, @04:28AM (#379543) Homepage Journal
    Please, people. This sort of rampant display of the idiocy of the DMCA (pdf) [x-omega.com] is fun, but it's not going to help much. What we need is real action. 2600 [2600.com] 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 [opendvd.org] - actually learn about the DMCA and the case against it.
    2. Electronic Frontier Foundation [eff.org] - donate to the actual court case
    3. US Congress [congress.org] - 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) [x-omega.com]

    --

  • by grahamm (8844) <gmurray@webwayone.co.uk> on Wednesday March 07 2001, @03:10AM (#379544) Homepage
    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?
  • slashdot, for the command line at the end of the example.
  • 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?

  • by dillon_rinker (17944) on Wednesday March 07 2001, @06:16AM (#379547) Homepage
    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)
  • >8^(

    I think that's a portrait of the people at the MPAA.
  • by Noryungi (70322) on Wednesday March 07 2001, @02:02AM (#379549) Homepage Journal
    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
  • by pallex (126468) on Wednesday March 07 2001, @02:00AM (#379550)
    Perl has got to be the only language where its actually more readable when compiled and then disassembled!
  • by fjordboy (169716) on Wednesday March 07 2001, @01:57AM (#379551) Homepage
    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.