I am trying to understand how DRM works under the hood. There doesn't seem to be much information about it on the web so I figured I would ask here.

After some attempted research, I found it extremely difficult to find any information regarding how Widevine or FairPlay DRM actually works. There is some general information about Content Decryption Module (CDMs) and such but how it actually works seems to be a mystery. I am wondering if this is intentional because much of DRM is maybe security through obscurity.

My basic/abstract understanding of DRM is that a file is encrypted usually using AES. When the file is attempted to be accessed by the DRM solution a key is transferred from a server to the CDM for it to be decrypted using some proprietary method (this is the part I am looking to understand better). The decrypted content is then given back to the application, often a browser, for playback. Is this correct?

If the above is the case, I assume that an attacker could simply edit the binary for the CDM to access the key or the file after is decrypted.


3 Answers 3


If the above is the case, I assume that an attacker could simply edit the binary for the CDM to access the key or the file after is decrypted.

That's why a lot of DRM systems are not implemented on Linux systems ...

To be able to run a DRM, the player must be "certified" by the DRM provider and must provide some secure way for this set key/decryption process.

On mobile device, it's often done using the TEE (Trusted Execution Environment), the SecureZone or whatever that is able to act as an crypto oracle on the system. For Windows, other mechanism are used, probably anti-debug at binary level, TPM, or something like that.

It doesn't mean that you won't be able to get the encryption key, just it will be quite difficult.

  • 1
    How does Linux make the ceritification process more difficult (or impossible). Plenty of DRM systems are implemented on macOS. I would think the issues with Linux would be similar to issues with macOS, is this true? If not, why not? Jan 10, 2020 at 17:19
  • The certification is an expensive process. You have to pay to certificate your software. Now, imagine, who would endorse this cost in an Open Source project. Remember that the cost if for supporting proprietary DRM, which, by definition, enslave the user.... the exact contrary of Open Source mindset :-)
    – binarym
    Jan 11, 2020 at 18:24

(Disclaimer: My POV can be slightly biased by the protection I tried to crack, I sometime speak about stuff I don't know, I presume it work this way because I know similar DRM tools working like that)

Conor is right: Speaking about DRM in general is far too broad: You speak about a server in your question but one of the most used copyright content doesn't even require a server (DVD).

DRM tool purpose:

There is a lot of different goals for DRM (can be geographical restriction, user restriction, and many others) but most of the time it's to avoid private copy of a proprietary work.

How DRM tools work:

The principle is almost always the same: You want to have the access X. 1) Get H[X] a cyphered copy of X. (By Download or a physical copy) 2) Get the key to convert H[X] to X. (Activating a licence, sometime automatic) 3) decypher H[X] to get X.

There is a ton of exceptions about how it works, sometime it's fully encrypted, sometime partially. Sometime it's a physical key, sometime virtual one... You can also find a ton of different module to make each copy unique, unreadable using someone else key, harder to RE, temporary available etc..

Is DRM security through obscurity?

99%: yes.

Why not 100%? Because (once again most of the time) you require someone that buy the content first to analyze the DRM and provide a workaround. In a certain way, DRM is fully secure until someone get an access to a copy. Thus said, every DRM are breakable.

Understand and cracking DRM

Because it's unpossible to speak about every DRM, we can't say attack is purely a binary decryption of the CDM. Let's speak about how DRM are mostly attacked using some simple example:

  • Music and Video content (Deezer): When downloading a song on Deezer, you will get unreadables files, and Deezer app has the key to open them. Keep it simple: Softwares like Audacity are able to grab the audio output. This vulnerability, working on every non-interactive content is called Analog hole

  • TV: TV content is a radio wave. If the content is protected, it will be cyphered. You need to buy a decoder, and you have access to TV. To crack this, you need to reverse the decoder at hardware level: understand how the logical circuit work and reproduce it. (There is also Analog Hole here, but It's less relevant as it's harder to keep it live)

  • Software: Here it's interesting, There is a lot of possibility. Firstly, you will have files encrypted specificaly for you and using the activation key (most of the time it's automatic) will connect your computer to the server, log with the key and it will give you a licence that will do verification and decypher your file. Here you got almost no choice to crack it: you will have to RE the binary. What to do then? Well, it depends. Because files are uncyphered on client side during software usage, it's always* possible to provide them to anyone (create a crack). Another possibility is to create a software that will reproduce the licence behavior**.

*Generally really hard, but not impossible.

**It's not always possible, there is a lot of other protection.

How to protect content?

There is 2 way to avoid cracks

  • Using the best security possible

As I said, It's hard but not impossible to crack a software, if you reach to produce an insanely efficient DRM tool, it can stand for months, years or decade.You need to evaluate how long your content will stay safe, and in how long it will be ok if your content is cracked. Because most of the content are not sold really often in their old day, a cracked version is not a problem at this time.

How to make a good protection?

(just my opinion) Hardware is really hard to understand, with physical protection and a lot of different implementation possibility, hardware protected content are probably among the hardest to revert.

  • Using a poor protection

Yes. It sounds weird but it "work". You are unable to protect your content at 100%? Very well, protect it and give a free modify copy of it! People won't bother creating a crack and people who didn't buy the content got a less pleasant version of it. Some games did this, honorable mention to Alan Wake that didn't affect the gameplay. It has some obvious disadvantage, but it's not that bad: - You can save mony on the DRM - People that use crack, probably wouldn't have buy the content even if no crack exist. (You don't lose much money)

TL;DR DRM is about obfuscation; wich is not 100% secure. Therefore, DRM implementation details are not revealed, even if there is models schema that are often used.

  • Very solid answer. Leaving unsolved for now to see if we get anymore answers. That being said, Could you explain a bit more how FairPlay or Widevine actually transmits the key to client? Maybe offer some tips on how the binaries could be cracked? Asking for a friend ;) Jan 11, 2020 at 19:07
  • I don't know much about Widevine and FairPlay. Except they are video/music DRM; meaning you can exploit analog hole if you have access to the content. If you don't, there is nothing you can do if no vuln exist. (It seems there is a side channel attack on Widevine )
    – MrHeliose
    Jan 13, 2020 at 17:05

Your basic understanding is fundamentally correct:

  • You have a media file or a media stream, which is encrypted with a symmetric key (almost always an AES-128 variant).
  • Users who want to play back that stream need to obtain a copy of that key but, just as crucially, need to have a piece of trusted software and trusted hardware. An example of that is the CDM running within all modern browsers.
    • The question is, trusted by whom? Why, by the content provider of course. In other words, the content publisher needs to have a good degree of confidence that the software/hardware the user is running on will enforce whatever content usage policy is in place (e.g. "rent for 48 hours and no longer").
    • This is key: the software/hardware needs to be trusted to handle the decryption process, and in particular the decryption key, in a way that makes it extremely hard for attackers to get access to either. In practice this means yes, obfuscation. But it might also mean (as mentioned in binarym's answer) a hardware-backed Trusted Execution Environment or similar. And a large number of (almost always proprietary) software tamper-proofing techniques.
  • Now let's go back to how the content key is delivered to a user's device. This is usually via some sort of cryptographic challenge/response mechanism, which means there is PKI involved. In other words, the key request is signed (to prove the device's identity) and the key response is encrypted with the device's public key.
    • The goal of this is to ensure that, even if the user were to take hold of the file where the key is eventually stored, they would not be able to distribute it to other devices, which are supposed to have different PKI unique material.

Different commercial DRM systems will employ variations of the above, but the general schema is more or less what is described above. (For a slight variations on the theme, see also this answer I gave on StackOverflow).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .