After DeCSS, DVD Jon Releases DeDRMS
An anonymous reader writes "Jon Lech Johansen, who reverse engineered FairPlay back in January, and wrote the decryption code that was later used by an anonymous developer to create the playfair utility, has released a similar utility: DeDRMS. It's only 230 lines. T-shirts anyone?"
Not that I have anything against C#, I actually find it quite nice, just stuck me as odd that someone would write a cracking toolin it. These things are traditionally written in C ( for speed ).... like DeCSS was.
Wow. This is written in C#. I wonder if we can get .NET banned now that we can prove it's used for illegal purposes :)
"In practice, the goal of maximizing publication regardless of the cost to freedom is supported by widespread rhetoric which asserts that public copying is illegitimate, unfair, and intrinsically wrong. For instance, the publishers call people who copy "pirates," a smear term designed to equate sharing information with your neighbor with attacking a ship. (This smear term was formerly used by authors to describe publishers who found lawful ways to publish unauthorized editions; its modern use by the publishers is almost the reverse.) This rhetoric directly rejects the Constitutional basis for copyright, but presents itself as representing the unquestioned tradition of the American legal system.
The "pirate" rhetoric is typically accepted because it blankets the media so that few people realize that it is radical. It is effective because if copying by the public is fundamentally illegitimate, we can never object to the publishers' demand that we surrender our freedom to do so. In other words, when the public is challenged to show why publishers should not receive some additional power, the most important reason of all -- "We want to copy" -- is disqualified in advance.
This leaves no way to argue against increasing copyright power except using side issues. Hence opposition to stronger copyright powers today almost exclusively cites side issues, and never dares cite the freedom to distribute copies as a legitimate public value."
Misinterpreting Copyright
Real, Inc.'s Realplayer now natively plays back iTMS purchases! It's Magic!
Perhaps for his next trick he will stand outside RIAA/MPAA headquaters holding a 6 foot neon sign that says SUE ME AGAIN!
I hope that eventually someone incorporates this code into a iTunes client for Linux, as it would be nice to be able to buy music from iTMS but I have no desire to buy a Mac.
Beep beep.
seriously however... anybody have a mirror of the code?
Lawsuits anyone?
SIG: TAKE OFF EVERY 'CAPTAIN'!!
This code shows with more simplicity than ever before how the FairPlay DRM scheme works. This can be used by programmers to add support for applications (i.e., GStreamer) to play encrypted files with a key produced from an iTunes username/password. It can be used by researchers to see any weaknesses in FairPlay and develop better methods. Unfortunately it can also be used by those who want to destroy the iTunes Music Service.
Interestingly, I believe the ideas could also be used to create files encrypted with a particular iTunes login, though perhaps I'm misunderstanding the scheme.
What does DVD-Jon have against Dr. Richard M. Stallman? Is this the utility that reverses changes made by RMS-Lint?
I could do it in one really long line of C. Without comments.
Let's host this program on Freenet, it is a project that make's the best use for what Freenet was made for.
http://dilbert.com/comics/dilbert/archive/images/d ilbert2004042261455.jpg
A somewhat odd view... does anyone know which big music firm United Media (the Dilbert owners) is affiliated with?
Beep beep.
For the junk filer:
jhsvjklhajskdvhakjsdhvalkjsdhkajdhfasd hsfvhasdhvf asdf asdf asdf asdf sdf asdhvashdvasdf asdf asd sdf coipx vxjzlk sdhvaasd fasd fadfg fiobvxcoizv jcxoixz jxzc sdhvaf cmdrtaco sucks akljdkls asd asd fvx sdhvas gh hh hhf dd sdf sf sd
hdvash jk k fgh jgdvvcbbn cv c dhvc c vb fg hdrghdfg fg dg df g dsf
ashdva sdfgsgewrr benrtnrt er er revr dv shdva aioajdoi jfasdioj v;xjf kldasjkl;vasj sdhva sjkdfsdkvn alkn lkan alksnsdflk nsfnvlad dhvahsdva aisovaiouvoivoiua ioua auao iuasi us shdva asivoa jvhbusa ui hiuahsiuhfsa ha ahsdjkfahkdj lfhalksjdfhalk askjda
vhasdvhasdjhvaksjdhva a kjas lkjdakljf svhasdhvaskjhvlaskjdvhas a kljs djklakslj af
asvhajkshvjkshas dhasdjvkhasdv akjdfjadf asds s d fsd fsad fads asdfas asdf asdf sdfs vxcvxcvzxcvx ss dfsdxvc dfa bioub oiu zklxcvx nsm,m,fns,m
sdfas ikj oixj movnxmcvnxcvo sdoifjs dfsddafgdfg kamlxcvbjio zkcnvzlk nxclk xcivx as df sdf asdf asd vi xoizjvzcvn socso s asd addfsdfahtgh fghdfgh df gd d
using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;
class M4PStream
{
private Rijndael alg;
private BinaryReader br;
private BinaryWriter bw;
private byte [] sbuffer;
private string AtomDRMS = "drms";
private string AtomMP4A = "mp4a";
private string AtomSINF = "sinf";
private string AtomUSER = "user";
private string AtomKEY = "key ";
private string AtomIVIV = "iviv";
private string AtomNAME = "name";
private string AtomPRIV = "priv";
private string AtomSTSZ = "stsz";
private string AtomMDAT = "mdat";
public M4PStream( FileStream fs )
{
br = new BinaryReader( fs );
bw = new BinaryWriter( fs );
sbuffer = br.ReadBytes( Convert.ToInt32( fs.Length ) );
alg = Rijndael.Create();
alg.Mode = CipherMode.CBC;
alg.Padding = PaddingMode.None;
}
byte [] NetToHost( byte [] Input, int Pos, int Count )
{
if( BitConverter.IsLittleEndian )
{
for( int i = 0; i < Count; i++ )
{
Array.Reverse( Input, Pos + (i * 4), 4 );
}
}
return Input;
}
int GetAtomPos( string Atom )
{
byte [] Bytes = Encoding.ASCII.GetBytes( Atom );
for( int i = 0; i < (sbuffer.Length - 3); i++ )
{
if( sbuffer[ i + 0 ] == Bytes[ 0 ] &&
sbuffer[ i + 1 ] == Bytes[ 1 ] &&
sbuffer[ i + 2 ] == Bytes[ 2 ] &&
sbuffer[ i + 3 ] == Bytes[ 3 ] )
{
return i;
}
}
throw new Exception( String.Format( "Atom '{0}' not found", Atom ) );
}
uint GetAtomSize( int Pos )
{
byte [] Bytes = new byte[ 4 ];
Buffer.BlockCopy( sbuffer, Pos - 4, Bytes, 0, 4 );
return BitConverter.ToUInt32( NetToHost( Bytes, 0, 1 ), 0 );
}
byte [] GetAtomData( int Pos, bool bNetToHost )
{
uint Size;
byte [] Bytes;
Size = GetAtomSize( Pos );
Bytes = new byte[ Size - 8 ];
Buffer.BlockCopy( sbuffer, Pos + 4, Bytes, 0, Bytes.Length );
return bNetToHost ? NetToHost( Bytes, 0, Bytes.Length / 4 ) : Bytes;
}
public void Decrypt( byte [] CipherText, int Offset, int Count,
byte [] Key, byte [] IV )
{
MemoryStream ms = new MemoryStream();
ICryptoTransform ct = alg.CreateDecryptor( Key, IV );
CryptoStream cs = new CryptoStream( ms, ct, CryptoStreamMode.Write );
cs.Write( CipherText, Offset, (Count / 16) * 16 );
cs.Close();
ms.ToArray().CopyTo( CipherText, Offset );
}
public byte [] GetUserKey( uint UserID, uint KeyID )
{
byte [] UserKey;
BinaryReader bruk;
string strHome =
Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData );
bool bUnix = Environment.OSVersion.ToString().IndexOf( "Unix" ) != -1;
string strFile = String.Format( "{0}{1}{
Drms = ~0.707(D)
$cat
What will the dairy farmers of the world think when they discover their Dairy Records Management System has been compromised? I will never drink milk ever again!!!
-Erik -- --This message was written using 73% post-consumer electrons--
I can sorta understand that, as far as I know, DVDs don't state at the time of purchase that you have to have X or Y, just that you have to have the disc. Fine.
So, when you buy something from the iTMS, it STATES that you have to have X or Y. It clearly states the restrictions that you agree to. This is not a hard concept, so why is it felt that a technological solution is required to 'fix' it?
Something that just struck me... DVD Jon isn't in the Americas, but iTMS isn't selling to those outside (maybe Canada, I'd have to check). So ... what part of this equation am I missing?
... and, so began, the legend of the Five-point Atkins Exploding Heart Technique!
If you attempt the impossible -- and make no mistake, copy-prevention is physically impossible, not just difficult -- then you will fail. You might be able to fool people into thinking you have succeeded, for a short while; but, sooner or later, your lies will catch up with you. All copy-prevention technology is pure snake oil, and can never work. It will always be defeated. Once a single CPT-free version has been created, then every penny anyone ever invested in that particular copy-prevention technology is wasted.
Je fume. Tu fumes. Nous fûmes!
Who says that "Dilbert" has sold out? You? Just because the strip portrays a view of downloading content that you find disagreeable, doesn't mean that the RIAA's got Scott Adams in their pocket.
It could just be that the man believes that you ought to pay for what you use for entertainment, if the creator of that entertainment wants payment.
http://cylan.deviantart.com/gallery/
I didn't expect it to be written in C#.
... surprise and fear ... fear and surprise ... Its two weapons are fear and surprise ... and ruthless efficiency ... Its three weapons are fear, surprise, and ruthless efficiency ... and an almost fanatical devotion to Redmond ... Its four ... no ... Amongst its weapons ... Amongst its weaponry ... are such elements as fear, surprise ... I'll try posting some other time.
NOBODY expects it to be written in C#!! Its chief weapon is surprise
"Oppression and harassment is a small price to pay to live in the land of the free." -- Montgomery Burns.
this is pretty cool, and a technical achievement... but why bother stripping the DRM from your m4p files? just make a functional iTunes clone that doesn't care about the DRM :)
or maybe i'm wrong... is it up to the player software to enforce the DRM? i thought i read somewhere that the iPod just ignores it...
You know, I saw that this morning, and I thought it was actually a pretty good wrap up (well, for what a comic can do anyway) of several of the main positions in the debate.
First, there are all the people who go snag copies of music because they're too a) lazy, b) stupid, c) cheap, or d) all of the above to either go buy a copy or just not buy it at all (don't give me shit: you think it costs too much or has too much filler, blah blah blah... don't buy the fucking thing, don't be a little baby about it). Then, there's the theiving nature of all the execs in the industry ripping off the artists. There's also the problem of overproduction, and the mentality of major artists that they have to make money but no, no... they're still doing it for the art.. really.
I thought it was a very good bit of satire, all around.
Alito: A vote for Alito is a punch in the eye to put that bitch back in her place!
The code looks so simple, as though .Net did all the work for him. Does this make .Net illegal under the DMCA?
I think that basically what you're missing is that 'they' can't tell you what you can and can't do with their products after you purchase them.
Replace 'they' with any manufacturer.
I could buy an apple that said "not for use as food." And I could then proceed to eat that apple - they have no say in what I do with it. If, for some reason, I should injure myself by eating that apple, they warned me and wouldn't be held liable. That's it. Laws come into play when I throw that apple and kill someone with it. Or try to sell it, claiming it is a pair.
Now, the argument here is that it is illegal to decrypt the 'protections' a company puts on their music. And it is here where it gets smelly realy, really quickly.
Sure, it might be the law, but it is written to be a pretty shitty law. (DMCA, etc). No, that's not an excuse to break the law, but it is one to cause sympathy for someone who does. There are very legitimate reasons for breaking the DRM on these files. There are also very illegitimate ones. Piracy comes to mind. You know, real piracy. Not some 14 year old girl that wants to give her friend some songs, but the people who mass produce and sell these songs on the black market.
The black market being, by the way, about every outdoor market I've been to in Asia or South America.
And you're right. DVD Jon shouldn't fall under any US laws. But the RIAA et al. will surely find a way to change that. Bastards.
I don't see the point you're trying to make. DVDs may not explicitly state that you have to do X or Y, but with CSS encryption combined with the DMCA, they might as well.
I think DVD Jon's being totally consistent here - if you pay to listen/watch/whatever something, you should have the right to do so on whatever platform or medium you choose, and not be limited by some artificial restriction imposed on you by the media companies.
So now people with Linux boxes can play their legit iTMS songs on their Linux boxes. Personally, I'm not bothered by this. There are other, easier ways for people to pirate music if they really have their heart set to it, so opening up a way for people to use something they've paid for in a way they see fit, while it may technically violate the license, is nothing I see worth getting up in arms over.
This same guy wrote DeCSS, FairPlay and DeCRMS....
wow. what a brilliant ballsy sun of a bitch.
because I have been enjoined by this Holy Office to abandon the false opinion which maintains that the Sun is the centre
http://hrothgar.mine.nu/dedrms.txt
A temporary mirror to the code. It wont be up more than a week, so dont bookmark it.
I can't really help you with the problems with installing the mono client... but this is what I did (with my win2k box)
www.go-mono.com -> c# compiler -> downloads page
get the file mono-0.31-win32-1.exe
run it, click okay a couple times...
get a copy of the code....
mcs DeDRMS.cs
and you have an exe that's command-driven.
command is : DeDrms.exe myfile.m4p
I might expose myself to legal liability under the DMCA if I were to use my +2 karma bonus to publicly point out that a copy of the DeDRMS code may be found buried in the parent AC post (currently at 0, and NOT posted by myself) that I am replying to. The DMCA would expressly forbid such a reply informing others of the existence of such a post.
Therefore, I wish to state emphatically that the parent contains no C# whatsoever and should not be moderated up as Informative, cut, pasted, compiled, or disseminated.
Exactly. There was a strip along the same lines a while back. Wally said something like "everything should be available free on the internet and creators should make their money from tips." Someone, I don't remember who, replied, "Great idea, we should try that with engineers."
Remember PlayFair
Remember the bitTorrent sites
If you want it, get it now.
Interesting how this news comes out on a Sunday, when the lawyers should all be out at play.
"It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
I mean, really. Why do you need much speed in anything other then a 3d game or some high-end server stuff that's going to be running constantly (like a web server or database).
Not to mention C isn't much faster then C# and java for most tasks these days.
autopr0n is like, down and stuff.
Would pay money for all of those.
They say the first thing to go is your penis. Well, it's either that or your brain. I forget which...
This tool seems to require that you already have your key stored in a file somewhere. This code just uses that key along with .NET's built-in cryptographic services to decrypt the data and write it back to the file.
Seems like getting your hands on the key in the first place would be the hard part...
Re installing Mono on Linux, you might do well to use the GARNOME packages; that way, you're building everything from source to be installed under its own prefix, and thus avoiding dependency hell.
Enjoy
This is a little offtopic, but since its written in C#, for those of you what don't have Visual Studio and don't want to mess with the command line tools (or don't have Mono on Linux) SharpDevelop is a great C# development product. Its GPL. Again a little of topic, but its always good to pimp your favorite software.
Yes, there's also a Linux version.
"Luke, I am your node.parent();"
They'd make iTunes work under WINE. As a side note I am sick and tired of people complaining that Apple does not let iTunes Music Store songs work under other media players. They do. Any media player can play iTunes Store music using the QuickTime API. All you have to do is write a plugin to interface with QuickTime. I wrote a QuickTime based media player a few years ago. Guess what? I started it up today and it played iTunes Music Store songs just fine. NO modifications. Its my own media player, yet it plays DRM'd music fine, no special un-DRMing.
make no mistake, copy-prevention is physically impossible, not just difficult
This is like observing that perfect algorithmic encryption, other than a one-time pad is impossible. So what? Who cares? Of course, I can't create a lock-and-key on my house that will keep all thieves out, all the time. So what? Who cares?
Whether or not my door can be physically manufactured to bar you forever from entry, makes it not one whit more legal for you to do so. All locks are rated, not in terms of their binary perfection, but rather in terms of the time and cost to defeat them. So what? Who cares?
You might be able to fool people into thinking you have succeeded, for a short while; but, sooner or later, your lies will catch up with you.
I suppose there are folks who are naive to think they live behind perfect locks. So what? Who cares? Where is the lie? What does it matter that technological solutions can be defeated? They are helpful, and substantially helpful to keep generally honest people honest, and stupid people (who represent most users) out. Smarter, less honest people, can of course get in any time. So what? Who cares?
For those smarter, less honest people, we have laws. Some will be smart enough to circumvent all of them and go free. Most will not.
Security is not a question of binary perfection. It is a question of doing as well as you may. Likewise with digital rights management.
There has always been piracy of musical content. Always. Some good, some bad. So what, who cares?
Just like DeCSS, playfair will be available to the less honest, smarter of us, or rebuilt by those who understand how it works. Those who think that this fact is useful have missed the point. These facts do not help our cause. To the contrary, it only helps those who insist that technology regulation, such as DMCA is required, and prevents the repeal of very bad laws.
Darn, I wish the smarter and less honest of us were just a little bit smarter about the ways of the world. For the smarter, honorable and ideologically motivated of us, such as Mr. J., we should excoriate, not praise, this sort of thing.
Our problem is that our arguments prove too much -- we demonstrate the "necessity" of the DMCAs, certainly to the satisfaction of the governments who will enforce them. The problem is NOT that there exists DRM, the problem is that the DRM is implemented and legally enforced in a manner that limits the scope of good new technology. It is that problem that WE, the technologists will have to solve -- hard or impossible it may be -- because the RIAA and MPAA certainly have no incentive to do so.
Judge: You again!?
Jon: Uhm, yeah.. sorry...
Judge: I guess the DVD people just won't leave you alone..
Jon: No, it's Apple's DRM now.
Judge: Damn you kid!!
Slashdot Sig. version 0.1alpha. Use at your own risk.
For those of you that don't know. It removes the protection from a .m4p file (Downloaded with iTunes) . So basically you end up with a Vanilla AAC file.
Where's the RPM for "Windows Update" again?
Reminds me of a story. Let me tell you about my tent.
I like going to SCA events. While we're there, we camp. And that means having all of our expensive gear in our tents, all our food, and our booze. Some of our gear can run in the thousands of dollars.
At my favorite event, we camp near the edge of the camp. And idiots from the local village sneak over the fence and rip us off every so often.
So I made a tent with a locking door. I built a yurt, and built into the frame a full sized, 1/2" thick, wood and iron reinforced door. With a working brass good-enough-for-your-house lock.
And while camping one year, a neighbor made fun of me for my efforts. "There's no way that would keep a determined criminal out," he said. It was still a canvas tent, albeit with a wood lattice frame. You could cut a hole through the canvas and break the lattices, easy. The door was too thin, you could kick it down. The lock could be defeated.
And I explained to him that the point was not to be burglar proof, just more burglar resistant than my neighbors.
At that moment, he was enlightened.
Weaselmancer
Weaselmancer
rediculous.
Follow the steps to compile and run it:
(1) Get the source code (at your own risk) and save it as DeDRMS.cs
(2) Download and Install the NET Framework SDK for FREE (reqiures Windows 2000, Windows Server 2003 or Windows XP).
(3) Use the included compiler csc.exe to compile the source code into executable code. Use this on command line (dos prompt) C:>csc DeDRMS.cs OR C:>csc.exe DeDRMS.cs
(4) It will create DeDRMS.exe in the same folder where you saved DeDRMS.cs.
(5) Profit or Jail??
1. Get and compile Mono (emerge mono for those of you with Gentoo). 2. In the command line, type: mcs DeDRMS.cs 3. Then type: mono DeDRMS.exe There ya go!
"Some fight for law. Some fight for justice. What will you fight for? One day, you will see."
Compiled Binary for Windows 2000/NT/XPS .exe
http://userwww.sfsu.edu/~astern/DeDRM
7.00 KB
C# Source
http://userwww.sfsu.edu/~astern/DeDRMS.cs
7.21 KB
Andrew
astern at s f s u dot edu
Remember that research that found that emulating the underlying hardware with a sufficiently intelligent userland dynamic profiler was usually faster than running directly on the underlying hardware? The dynamic profiler can optimize like no compiler will ever be able to do with static analysis. It's a similar principle to what Transmeta does with their x86 emulation. Modern Just-In-Time Compilers use dynamic profiling to accelerate things, and they're getting quite good. It's certainly quite possible to design a C# vector class that's both more memory and processor efficient in most cases than C++. Here's how:
1) Record in the virtual machine/JIT every time a vector gets resized.
2) Based on the pattern of resizing, speculatively allocate for new vectors/resizes as much memory as they'll ever need, or at least as much as they'll need any time soon.
3) When you guess wrong about a speculative allocation, adjust your speculation.
C++ doubles the amount of space allocated for a vector (or queue, or list, or stack, or dequeue, or binary heap, etc) whenever a resize exceeds the amount already allocated, unless you know enough to tell it to do otherwise. This keeps the amortized cost of increasing size by one constant. C++ doesn't benefit from profiling like C# does because there's no virtual machine that can change what binary code is actually sent to the processor. You could hack vector profiling together yourself, but it would be slow. Of course, this doesn't really help C# if you're never resizing your vectors, but that doesn't mean C# can't do better than C, even if C++ will have it beat. If you've ever done much benchmarking of the C++ STL, you know that it's usually faster than otherwise identical code written with arrays, which shouldn't be possible, since the array access code can be done fairly easily in assembly without virtual function table lookups and such, but nonetheless is quite real.
The trick to this whole scheme is doing the speculation quickly and accurately. We may not be to the point yet where JIT code reliably outperforms statically compiled code in less space, but there are an army of extraordinarily intelligent grad students out there writing dissertations on the topic, and I assure you they'll make it happen.
WARNING: there is a trojan on your
By saying Apple's DRM is good, you're falling right into the content companies' "trap" (scare quotes because I'm not convinced it was intentional, though the result is still the same). This is the same way many bad laws get passed: proponents of the bad law propose a law that's several times worse, wait for the backlash, then "fall back" to what they wanted to push through in the first place--and most people will agree that it's an improvement and let it go.
Distribution of copyrighted material is already illegal. DRM can always be circumvented. People will probably be willing to pay reasonable prices for songs online if they're guaranteed quality and the freedom to do what they want with the file, though I'll grant that payment methods are still a mostly unresolved issue. Hence there's no need for DRM, and even DRM as "fair" as Apple's is an improper infringement on users' rights. (Unless you believe content really belongs to the creators rather than to the culture--but that's not the stance the Framers took.)
I'm reminded of an old saying I heard about negotiation tactics: "If you want Australia, ask for the world and give away five continents."
Computer code is the way we request that a computer performs a task.
We don't do it in plain English (or Spanish, Russian, Mongolian or whatever) because we lack the technology (still) to do so.
If in the future it is possible to program a computer or any other machine with a normal conversation then how the hell are all the ridiculous copyright and patent laws are going to be applied?
As things stand computer languages are a necessary nuisance to allow people express in a succint and understandable manner their own ideas about how ro solve problems.
This is perhaps one of the purest forms of speech, which should be mantained unecumbered of patents and covered by fair copyright laws.
IANAL but write like a drunk one.
Now, project yourself forward 20 years. Will these same profit chasing record companies be willing to provide infrastructure to allow you to move your DRM encrusted music from PC to PC throughout the rest of your exepcted life, and that of your descendants who will inhereit this media? Sure, they'll be happily putting out more music, but are they protecting your previous investments? In the year 2039 when I should be just about ready to breathe my last breathe will I be able to hear all my old favorite albums or will I cark it listening to gangster rap on the radio because my rightfully paid for music isn't authorised for use on my new funky media player.
This DRM stuff is OK for playing todays tunes, but I worry about the longevity of the media.
All those moments will be lost in time, like tears in rain.