wiki:DrmLib

Drm

back


Introduction

A very good introduction to 'drm' - or digital rights management can be found on wiki:

This will give you a good outline of the pros and cons.

This page describes an implementation, based on Microsofts DRM SDK.

There is a fully open source drm kit:  openimp


Microsoft lets you sign a license agreement.

I think I am allowed by this agreement to disclose my own code, however, I will not disclose the key I got from Microsoft.

So a big notice is: if you want this code to actually work, you will need a key from Microsoft and you will need to sign the agreement with them.

Secondly, Microsofts DRM SDK is not in this repository. You will get the SDK as part of your license agreement.

This means the code does not compile.

Sorry.

You can, however, use it as reference material - or compile it when you do get the SDK.


Design

My drm implementation consists of 3 parts:

  • encode
  • package
  • license

I think this is how it works: the DRM SDK only accepts files (audio/video) in WMV format. I know, MSDN says somewhere the SDK also accepts ISO-MPEG4, but if you feed it this, the packager will simply choke and you get nothing. So you need to reencode your divx/xvid/mov to something the SDK accepts first.

Mind you, the encoder is picky too :)

After you encode it, packaging is quite straight forward - you will get an encrypted file ready for distribution.

All you need to do then is get a webserver online and listen for license requests. Microsoft provides you with some horrible, unusable ASP code, so I wrote my webservice in C#.


Parts

The following will describe each of the parts in more detail.

Encoder

Packager

License