7

I have a MPD clip which supports CENC,how to decrypt and play without using any specific DRM engine??Is there any decryption algorithm available to decrypt AES CTR 128 bit?If so will it be used to decrypt MPEG-DASH content?There are some third party libraries available in net like NACL,Openssl,crypto++,which can do AES ctr 128 decryption.Can i use one of them to decrypt DASH Content(CENC supported) ??

3 Answers 3

12

MPEG-CENC is simply AES-128 CTR encryption on an ISO BMFF (mp4) file. The specification for how this is applied to CENC is here: https://www.w3.org/TR/2014/WD-encrypted-media-20140828/cenc-format.html and https://www.iso.org/obp/ui/#iso:std:iso-iec:23001:-7:ed-1:v1

And a good explanation of AES-128 CTR https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_.28CTR.29

To decrypt you will need the key and also the Initialization Vector (IV) that was used to encrypt the content. This is available from the senc and tenc boxes in the mp4 file. Once you will have those you will simply need to go through the samples or fragments of the file and decrypt and reassemble the mp4 (assuming you want to play it).

As mentioned by Bento tools mp4decrypt gives an example on how to do this: https://github.com/axiomatic-systems/Bento4/blob/master/Source/C%2B%2B/Apps/Mp4Decrypt/Mp4Decrypt.cpp

1
  • @Alastair I have a MPEG-CENC encrypted file and its key but not the iv. Any idea how to get the iv from the video ? It was encrypted using ffmpeg command that just takes key param.
    – rd7773
    Commented May 24, 2018 at 11:06
5

DASH videos protected using CENC can be played back using many different DRM technologies. The primary factors you need to care for are:

  • The player used must support the chosen DRM technology. Of the popular browsers, Internet Explorer 11 supports PlayReady and Chrome supports Widevine. For non-browser platforms, various 3rd party players are available.
  • The video must contain metadata that allows the DRM technology to recognize the actions needed in order to decrypt the video (most importantly, the ID of the encryption key and the URL to acquire it from).
  • There must be a service running that will provide the decryption key to the player on demand, after validating that the user is authorized to view the video. Generally, the key is embedded in a data structure called a license which can provide additional data to the player regarding content protection requirements (e.g. "HDCP must be turned on to play this video").

Note that in order to reach a wide spectrum of players, you will need to support multiple DRM technologies simultaneously.

You will find some references to the DRM technologies at the DASH-IF content protection references page.

Note that some browsers may also support the "clearKey" DRM technology, which is a fake implementation that simply takes the decryption key and uses it directly. If you have the decryption key and a video, you can use the clearKey mechanism to play your video.

Edit: If you have the cryptographic key then you can use the mp4decrypt tool from the Bento4 suite to decrypt the fragment files.

1
  • I have seen some third party libraries like Openssl,NACL,crypto++ which can do the decryption of AES ctr 128.Can i use this for decryption?? Commented Jan 2, 2015 at 8:16
0

ClearKey via MPEG-CENC and the HTML5 Encrypted Media Extentions is supported by some browsers, e.g. Google Chrome. Other browsers may have to use a fallback to do the decryption e.g. using Flash.

MPEG-CENC using Clearkey in HTML5 as well as Flash is shown on this demo website http://www.dash-player.com/demo/drm-and-protection/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.