How to decrypt and play CENC content in DASH?

I have an MPD clip that supports CENC, how to decrypt and play without using any specific DRM mechanism? Is there any decryption algorithm available to decrypt AES CTR 128 bits? If this will be used to decrypt MPEG-DASH content There are some third party libraries available on the net like NACL, Openssl, crypto ++ that can do AES ctr 128 decryption. Can I use one of them to decrypt DASH content (supported CENC)?

+5


source to share


3 answers


MPEG-CENC is just AES-128 CTR encryption in ISO BMFF (mp4) file. The specification of how this applies to CENC is given here: https://www.w3.org/TR/2014/WD-encrypted-media-20140828/cenc-format.html and also 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 a key as well as an initialization vector (IV) that was used to encrypt the content. This is available in senc and tenc blocks in the mp4 file. Once you get them, you just have to go through the samples or file chunks and decrypt and rebuild the mp4 (assuming you want to play it).

As mentioned in 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

+8


source


CENC-protected DASH videos can be played using various DRM technologies. The main factors that you need to pay attention to are:

  • The player used must support the selected DRM technology. Of the popular browsers, Internet Explorer 11 supports PlayReady and Chrome supports Widevine. Various third party players are available for non-browser platforms.
  • The video must contain metadata that allows DRM to recognize the actions required to decrypt the video (most importantly, the encryption key ID and URL to retrieve it).
  • A service must be running that will provide the decryption key to the player on demand after verifying that the user is allowed to view the video. Typically, the key is embedded in a data structure called a license, which can provide additional data to the player with respect to content protection requirements (eg, "HDCP must be enabled to play this video").

Please note that you will need to support multiple DRM technologies at the same time to reach a wide range of players.



You will find links to DRM technologies on the DASH-IF Content Protection Links page .

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

Edit: If you have a cryptographic key, you can use Bento4 's mp4decrypt tool to decrypt the chunk files.

+5


source


ClearKey via MPEG-CENC and HTML5 Encrypted Media Extentions is supported by some browsers, for example. Google Chrome. Other browsers may have to use a backup for decryption, for example. using Flash.

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

-1


source







All Articles