# Encrypt MPEG-DASH track separately

**URL:** https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931
**Category:** Wowza Streaming Engine
**Created:** [September 7, 2015, 3:48pm UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931 "2015-09-07T15:48:38Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![CW\_Shue](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@CW\_Shue](https://community.wowza.com/u/CW_Shue)
#### Post date: [September 7, 2015, 3:48pm UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/1 "2015-09-07T15:48:38Z")

</div>

Hi,

How can I use different encryption key for each MPEG-DASH tracks?

For example:

- key for audio track

- key for video track

And even better, how to inspect the resolution of current stream so encryption key specific for HD content could be used.

I could not find a way to make it work with:

[PHP]public void onHTTPMPEGDashEncryptionKeyVODChunk(HTTPStreamerSessionMPEGDash httpSession, IHTTPStreamerMPEGDashIndex index, CencInfo cencInfo, long chunkId)[/PHP]

Best Regards,

Chaiwat

---

<div class="post-metadata">

### Author: ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)
#### Post date: [September 22, 2015, 3:47am UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/2 "2015-09-22T03:47:13Z")

</div>

Hello Chaiwat

Currently we only support per session encryption. Please see the [following](https://www.wowza.com/docs/how-to-secure-mpeg-dash-streaming-using-common-encryption-cenc%28CENC%29) for further implementation level details.

Thanks,

Matt

---

<div class="post-metadata">

### Author: ![CW\_Shue](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@CW\_Shue](https://community.wowza.com/u/CW_Shue)
#### Post date: [September 22, 2015, 4:03pm UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/3 "2015-09-22T16:03:17Z")

</div>

Hi Matt,

So per-session encryption is using the same key for both video and audio tracks, right? (I saw a single call to “onHTTPMPEGDashEncryptionKeyVODChunk” method for each session).

Do you have any plan to support different key for each track? Since Widevine provides HD, SD, and AUDIO key.

Best,

Chaiwat

---

<div class="post-metadata">

### Author: ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)
#### Post date: [September 29, 2015, 1:11pm UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/4 "2015-09-29T13:11:16Z")

</div>

Hello Chaiwat

The per track encryption is now in our backlog list. There is no timeframe for its inclusion, however.

One thing you did mention was that you’d like to inspect the resolution of the current stream such that encryption key is specific for HD content etc. Since you are defining the source stream names, you could filter on the source stream name in onHTTPMPEGDashEncryptionKeyVODChunk api event handler and provide the corresponding key by it.

Thanks,

Matt

---

<div class="post-metadata">

### Author: ![Andy\_Engberson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/andy_engberson/32/392_2.png) [@Andy\_Engberson](https://community.wowza.com/u/Andy_Engberson)
#### Post date: [September 9, 2016, 12:56am UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/5 "2016-09-09T00:56:42Z")

</div>

Hi,

There is no update to this backlog feature request. I have passed on your interest. Thanks for the feedback.

Regard,

Andy\_E

---

<div class="post-metadata">

### Author: ![Alexey\_R](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@Alexey\_R](https://community.wowza.com/u/Alexey_R)
#### Post date: [August 3, 2016, 4:15pm UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/6 "2016-08-03T16:15:42Z")

</div>

Any update on this issue?

Widevine is enforcing usage of different track keys for audio and video tracks ([see more](https://www.widevine.com/product_news.html)), so it’s more relevant now.

> Widevine would like to reinforce our recommendation of using separate content keys to encrypt each video and audio track. In particular, the emphasis is on using separate content keys for each SD, HD, UHD and Audio stream.

---

<div class="post-metadata">

### Author: ![Wendong\_Li](https://avatars.discourse-cdn.com/v4/letter/w/f08c70/32.png) [@Wendong\_Li](https://community.wowza.com/u/Wendong_Li)
#### Post date: [April 17, 2017, 9:01am UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/7 "2017-04-17T09:01:31Z")

</div>

Hi @Matt Young,

In sentence “you could filter on the source stream name in onHTTPMPEGDashEncryptionKeyVODChunk api event handler and provide the corresponding key by it”, by “source stream name”, do you mean the published stream name, like “myStream.smil”, or the source streams for each bitrate, like “myStream\_720p”?

If it’s “myStream\_720p”, that means we can still apply different keys for different bitrates, and therefore apply different keys for different tracks. Is this understanding correct?

Thanks,  
Wendong

---

<div class="post-metadata">

### Author: ![Wendong\_Li](https://avatars.discourse-cdn.com/v4/letter/w/f08c70/32.png) [@Wendong\_Li](https://community.wowza.com/u/Wendong_Li)
#### Post date: [April 17, 2017, 9:21am UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/8 "2017-04-17T09:21:55Z")

</div>

As mentioned by @Alexey R, using different encryption keys for SD and HD bitrate variants is a strong recommendation from Widevine. This recommendation comes from the concerns from the content provider on the security of the HD content.

If this is currently not achievable in Wowza streaming engine, for service providers with HD contents, it is a blocking issue, and it will be helpful if you can share the plan on adding this support.

Thanks,

---

<div class="post-metadata">

### Author: ![Wendong\_Li](https://avatars.discourse-cdn.com/v4/letter/w/f08c70/32.png) [@Wendong\_Li](https://community.wowza.com/u/Wendong_Li)
#### Post date: [April 18, 2017, 2:48am UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/9 "2017-04-18T02:48:46Z")

</div>

Any response please…

---

<div class="post-metadata">

### Author: ![Wendong\_Li](https://avatars.discourse-cdn.com/v4/letter/w/f08c70/32.png) [@Wendong\_Li](https://community.wowza.com/u/Wendong_Li)
#### Post date: [April 19, 2017, 7:09am UTC](https://community.wowza.com/t/encrypt-mpeg-dash-track-separately/36931/10 "2017-04-19T07:09:46Z")

</div>

By testing, we confirmed that callback

```auto
onHTTPMPEGDashEncryptionKeyLiveChunk

```

comes once per bitrate source (for each chunk), and by checking parameter “streamName” in the callback we can differentiate different bitrates and apply different keys. This also works for audio if you use a separate source for audio.

However, this doesn’t work for VOD as callback

```auto
onHTTPMPEGDashEncryptionKeyVODChunk

```

comes only once (for each chunk), and there doesn’t seem to be a way to apply different keys.
