Most recently updated 2000-08-29
(Thanks to Joshua McGee for some plausible corrections.)

 This song, 6 MB in MP3 format, may be found at [1] or [2].

 The author and singer, Joe Wecker, sings the algorithm of the
 function dss_descramble, which is arguably the heart of the DeCSS
 package for unencrypting the contents of a DVD movie. His guide
 for rendering the C code into plain English was this version [3]
 by CMU professor Dave Touretzky, who testified as a witness in
 the recently concluded first phase of the DeCSS trial [4].

       The C code source for this function [5] is 26 lines, 532
       characters. The 6-1/2-minute song runs to 162 lines and nearly
       3600 characters. The sung function represents about 2% of the
       source code of DeCSS as distributed. At this rate, singing the
       whole package would occupy nearly half a CD-ROM and take 5 hours
       to perform. (Maybe less because you wouldn't need to sing the code
       comments.)

 -- Keith Dawson

[1] http://www.joeysmith.com/~jwecker/descramble.mp3
[2] http://www.xmission.com/~smit5898/descramble.mp3
[3] http://www.cs.cmu.edu/~dst/DeCSS/Gallery/plain-english.html
[4] http://www.linuxworld.com/linuxworld/lw-2000-08/lw-08-decsswrapup_p.html
[5] http://www.cs.cmu.edu/~dst/DeCSS/Gallery/c-anonymous.c
______________________________

descramble.mp3

this function is void
it takes two args
the first is SEC, a pointer to a vector of 2048 unsigned bytes:
that are the encrypted disk sector and will be the decrypted

the second is KEY
a vector of 6 unsigned bytes:
the decrypted title key

local variables t1 through t6 are unsigned ints
local variable END is a pointer to SEC plus 2048

 dmca steps on me
 i don't like the dmca
 it makes this song illegal
 ooh woe dmca
 it steps on me
 it makes this song illegal
 makes this song illegal yeah

retrieve byte zero of KEY
XOR it with byte 84 of SEC
and treat the result as an integer
OR it with the hexidecimal constant 0x100
and store the result in t1

step 2:
retrieve byte 1 of KEY
XOR it with byte 85 of SEC
and store the result in t2

step 3:
take bytes 2 through 5 of KEY
and XOR them with bytes 86 through 89 of SEC
store the result in t3

step 4:
take the low-order three bits of t3
which can be computed by the AND of t3 with the constant 7
and store the result in t4

 i hate the dmca
 it makes this code i wrote
 aw, it makes it dumb
 it makes it illegal
 i hate the dmca
 it makes this stuff i wrote
 makes this song illegal
 makes this song illegal
 it makes this song illegal

5:
multiply t3 by 2, add 8, subtract t4
and store the result back in t3

step 5-1/2:
advance SEC by 128 bytes

step 6:
store 0 in t5

7:
begin a WHILE loop

and 8:
continue iterating while SEC does not equal END
use t2 as an index into table CSStab2
and retrive a byte which we'll call b1 and t1

[sic: no step 9]
use t1 as an index into table CSStab3
and retrieve another byte
which we'll call b2
compute b1 XOR b2
and store the result in t4

step 10 is:
shift t1 right by one bit
and store the result in t2

step 11:
take the low-order bit of t1
which can be obtained by taking the AND of t1 and the constant 1
shift it [by] left by 8 bits and XOR it with t4
and store the results back in t1

 ohh, the dmca
 hey, hey, is so dumb
 ahh, the dmca
 is so dumb
 oh, it's so dumb

step 12:
use t4 as an index into table CSStab5
and retrive a byte
store the result in t4

-- accellerando --

[sic: no step 13]
shift the constant of t3 right by 3 bits
XOR it with t3 shifted [left by] right by one bit
XOR it with t3 shifted [mmph] right by eight bits
XOR it with t3 shifted [mmph] right by five bits
and extract the low-order byte by ANDing it
with the hexadecimal constant 0xff
store the result in t6

step 14:
shift the contents of t3 left by 8 bits
OR it with t6
and store the result in t3

step 15:
use t6 as an index into table CSStab4
and retrive a byte
store the result in t6

step 16:
add together t6, t5, and t4
and store the result back into t5

step 17:
use the byte pointed to by SEC as an index into table CSStab1
take the retrieved byte
and XOR it with the low-order byte of t5
which can be extracted by ANDing t5 with the hexadecimal constant 0xff
store the result back into the byte pointed to by SEC
and advance the pointer SEC by one byte

step 18:
shift t5 right by 8 bits and
and store the result back into t5

as step 19:
return to step 8 to continue looping

and 20:
this is where we end up when the loop is complete

21:
return from the procedure

ahh, that's the end of descramble, folks, that's the end
that's the end of descramble, folks, the end
that's the end of descramble, folks, the end

 ahh, i hate the dmca
 i hate the dmca
 i hate the dmca
 the dmca infringes on me
 it steps on me
 steps on me
 steps on me
 ahh, i'm not free
 it steps on me
 i'm not free
 ahh, it steps on me
 i'm not free