# Live HLS AES encrypted with rotating keys

**URL:** <https://community.wowza.com/t/live-hls-aes-encrypted-with-rotating-keys/46578>\
**Category:** Wowza Streaming Engine\
**Created:** [February 10, 2016, 12:31pm UTC](https://community.wowza.com/t/live-hls-aes-encrypted-with-rotating-keys/46578 "2016-02-10T12:31:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joaquin\_Villanueva](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Joaquin\_Villanueva](https://community.wowza.com/u/Joaquin_Villanueva)\
**Post date:** [February 10, 2016, 12:31pm UTC](https://community.wowza.com/t/live-hls-aes-encrypted-with-rotating-keys/46578/1 "2016-02-10T12:31:56Z")

</div>

Hi,

I’m trying to set up an hls live stream with AES encryption. But need to do a time-based key rotation. I’ve managed to succesfully stream a live AES encrypted feed with external key checking [https://www.wowza.com/docs/how-to-secure-apple-http-live-streaming-aes-128-external-method](https://www.wowza.com/docs/how-to-secure-apple-http-live-streaming-aes-128-external-method), but the key check url was called only and play start. There’s a way to force the key check url call every nth chunk or every n seconds using the external AES encryption mechanism?

Maybe the internal AES encryption is the way to go, but without experience programming server-side apis i think it’s better to know other’s experiences about this matter. Mainly if it will be feasible with the external AES method or must go with the internal api method developing a custom class.

Thanks!

---

<div class="post-metadata">

**Author:** ![Jason\_Hatchett](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/jason_hatchett/32/391_2.png) [@Jason\_Hatchett](https://community.wowza.com/u/Jason_Hatchett)\
**Post date:** [May 4, 2016, 2:50am UTC](https://community.wowza.com/t/live-hls-aes-encrypted-with-rotating-keys/46578/2 "2016-05-04T02:50:57Z")

</div>

Hello,

I would actually suggest considering using the Secure Token option since you can set an expiration on the token that is generated.

[https://www.wowza.com/docs/how-to-protect-streaming-using-securetoken-in-wowza-streaming-engine](https://www.wowza.com/docs/how-to-protect-streaming-using-securetoken-in-wowza-streaming-engine)

You can review all of your Media Security options here:

[https://www.wowza.com/docs/media-security-overview](https://www.wowza.com/docs/media-security-overview)

If the Secure token method will not work for your workflow please let me know why and provide as much detail as you can about your workflow so I can better assist you.

Regards,

Jason Hatchett
