# Issue with HLS AES encrypted on DVR playback

**URL:** https://community.wowza.com/t/issue-with-hls-aes-encrypted-on-dvr-playback/53369
**Category:** Wowza Streaming Engine
**Tags:** encoder
**Created:** [May 16, 2019, 3:53pm UTC](https://community.wowza.com/t/issue-with-hls-aes-encrypted-on-dvr-playback/53369 "2019-05-16T15:53:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Chloe\_Gouteron](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@Chloe\_Gouteron](https://community.wowza.com/u/Chloe_Gouteron)
#### Post date: [May 16, 2019, 3:53pm UTC](https://community.wowza.com/t/issue-with-hls-aes-encrypted-on-dvr-playback/53369/1 "2019-05-16T15:53:42Z")

</div>

Hello,

We followed the procedure in [https://www.wowza.com/docs/how-to-test-aes-encryption-for-apple-hls-streams](https://www.wowza.com/docs/how-to-test-aes-encryption-for-apple-hls-streams) but at the point 9, we succeeded in video chunk reading contrary to what it was expected.  
With our Wowza-DVR, we created a video without encryption (cupertinoEncryptionAPIBased to false) and we want to read it with a HLS encryption.  
For the tests, we are reading video with VLC (type = httpstreamer).  
What did we miss?

A few complementary informations:

- We see in our logs that we see just one time in onHTTPCupertinoEncryptionKeyLiveChunk that we override (IModuleOnHTTPCupertinoEncryption interface). So, the CupertinoEncInfo is set only once.
- On VLC Message side, we noticed that the decode URL is never called.
- In our Wowza-dvr Application.xml, we have:

```auto
<StreamType>live</StreamType>

<Property>
   <Name>cupertinoEncryptionAPIBased</Name>
   <Value>true</Value>
   <Type>Boolean</Type>
</Property>

```

Example of our Java logs when reading the video :

```auto
2019-05-15 08:43:47,429 | TRACE | RecordModule | 
Service[RecordApplication] resolvePlayAlias IHTTPStreamerSession > 
IHTTPStreamerSession [HTTPStreamerSessionCupertino]
2019-05-15 
08:43:47,429 | DEBUG | RecordModule | Service[RecordApplication] 
resolvePlayAlias [LMiy7MBOadaPsl5fxLEMvXJQeqeq] -> [dvrVideoTest-01]

2019-05-15 08:43:47,473 | DEBUG | RecordModule | Service[RecordApplication] onStreamCreate [] type = httpstreamer
2019-05-15 08:43:47,473 | INFO | _definst_ | null
2019-05-15 08:43:47,474 | INFO | _definst_ | null
2019-05-15 08:43:47,474 | INFO | _definst_ | DvrStreamManagerBase.init archiveStrategy=append
2019-05-15
 08:43:47,474 | INFO | _definst_ | 
DvrStreamManagerBase.initProperties[RecordApplication/_definst_/dvrVideoTest-01]
 : {Properties: mpegdashPlaylistChunkCount: 3, 
smoothFragmentTargetAudioDuration: 1000, cupertinoPlaylistChunkCount: 3,
 startRecordingOnStartup: true, mpegdashRepeaterChunkCount: 3, 
mpegdashMaxChunkCount: 5, dvrEncryptionSharedSecret: "AGoodSecret", 
mpegdashChunkDurationTarget: 1000, isDvrPacketizer: true, 
cupertinoMaxChunkCount: 6, cupertinoChunkDurationTarget: 2000, 
cupertinoRepeaterChunkCount: 3, cupertinoEncryptionAPIBased: true}

2019-05-15
 08:43:47,474 | DEBUG | RecordModule | Service[RecordApplication] 
onHTTPCupertinoEncryptionKeyLiveChunk dvrVideoTest-01
2019-05-15 
08:43:47,475 | INFO | HLSEncryptionHandler | 
Service[HLSEncryptionHandler DVR] onHTTPCupertinoEncryptionKeyLiveChunk 
dvrVideoTest-01
2019-05-15 08:43:47,475 | DEBUG | 
HLSEncryptionHandler | Service[HLSEncryptionHandler DVR] 
[setEncryptionAES] sessionId calculated for dvrVideoTest-01
2019-05-15
 08:43:47,475 | DEBUG | HLSEncryptionHandler | 
Service[HLSEncryptionHandler DVR] [setEncryptionAES] generated key = 
97b472683f2371b2fa57fb7784651a45, 
https://10.46.46.69:8191/decoderecords?sessionId=b3BEc3pxdXBPcERzei4xMg==
2019-05-15
 08:43:47,475 | DEBUG | HLSEncryptionHandler | 
Service[HLSEncryptionHandler DVR] [setEncryptionAES] generated HEX key =
 [-105, -76, 114, 104, 63, 35, 113, -78, -6, 87, -5, 119, -124, 101, 26,
 69]

2019-05-15 08:43:47,476 | INFO | _definst_ | 
DvrStreamManagerBase.init[RecordApplication/_definst_/dvrVideoTest-01]: 
Encrypt Cupertino stream: key: *1a45 url: 
https://10.46.46.69:8191/decoderecords?sessionId=b3BEc3pxdXBPcERzei4xMg==
2019-05-15
 08:43:47,477 | INFO | _definst_ | 
DvrStreamManagerBase.initStorage[RecordApplication/_definst_/dvrVideoTest-01]
 : storeName:dvrfilestorage isRecorder:true hasStorage:true
2019-05-15
 08:43:47,479 | INFO | _definst_ | 
DvrStreamStoreBase.initProperties[RecordApplication/_definst_/dvrVideoTest-01/dvrVideoTest-01.0]
 : properties:
[dvrWindowDuration:0, dvrChunkGroupingSeconds:600, 
dvrAllowableAVPacketDelta:2000, dvrResetTimePacketDelta:200, 
dvrPacketDeltaToNotify:200]
2019-05-15 08:43:47,479 | INFO | 
_definst_ | 
DvrStreamStoreBase.ReadCache[RecordApplication/_definst_/dvrVideoTest-01]
 DISABLED
2019-05-15 08:43:47,484 | INFO | _definst_ | 
MediaStreamMap.getLiveStreamPacketizer[RecordApplication/_definst_/dvrVideoTest-01]:
 Create live stream packetizer: dvrstreamingpacketizer:dvrVideoTest-01
2019-05-15 08:43:47,485 | INFO | _definst_ | null

2019-05-15
 08:44:21,607 | DEBUG | RecordModule | Service[RecordApplication] 
onStreamDestroy [dvrVideoTest-01] type = httpstreamer

2019-05-15 
08:48:47,575 | INFO | _Server_ | DvrStreamManagerBase 
[RecordApplication/_definst_/dvrVideoTest-01] : Timeout occurred.  
Destroying DVR recorder.
2019-05-15 08:48:47,575 | INFO | _Server_ |
 DvrStreamManagerBase [RecordApplication/_definst_/dvrVideoTest-01] : 
Timeout occurred. Destroying DVR packetizer.
2019-05-15 08:48:47,575 | INFO | _Server_ | DvrStreamManagerBase.shutdown[RecordApplication/_definst_/dvrVideoTest-01]
2019-05-15
 08:48:47,576 | INFO | _Server_ | 
DvrStreamManagerBase.removeStreamStore[RecordApplication/_definst_/dvrVideoTest-01]
 : stream:{DvrStreamStoreBase streamName:dvrVideoTest-01.0 isLoaded:true
 canPlay:true canRecord:true hasEncryption:false isLive:false 
isRecording:false isRecordingPaused:false props:{Properties: 
mpegdashPlaylistChunkCount: 3, smoothFragmentTargetAudioDuration: 1000, 
cupertinoPlaylistChunkCount: 3, startRecordingOnStartup: true, 
mpegdashRepeaterChunkCount: 3, mpegdashMaxChunkCount: 5, 
dvrEncryptionSharedSecret: "AGoodSecret", mpegdashChunkDurationTarget: 
1000, isDvrPacketizer: true, cupertinoMaxChunkCount: 6, 
cupertinoChunkDurationTarget: 2000, cupertinoRepeaterChunkCount: 3, 
cupertinoEncryptionAPIBased: true}].
2019-05-15 08:48:47,576 | INFO |
 _Server_ | 
MediaStreamMap.removeLiveStreamPacketizer[RecordApplication/_definst_/dvrVideoTest-01]:
 Destroy live stream packetizer: dvrstreamingpacketizer

```

Thank you for your help,  
Regards,  
Chloe

---

<div class="post-metadata">

### Author: ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)
#### Post date: [May 24, 2019, 10:32pm UTC](https://community.wowza.com/t/issue-with-hls-aes-encrypted-on-dvr-playback/53369/2 "2019-05-24T22:32:27Z")

</div>

Hi @Chloe Gouteron, sorry for the delayed response, I was out of the office. This is interesting and thanks for sharing what you have tried and what the logs showed.

Did you get a final solution for your support ticket 320629?

I spoke with our engineers and they would like to view all the logs and files to run some tests.They can only do this through a support ticket however and you can submit it here:

[https://www.wowza.com/support/open-ticket](https://www.wowza.com/support/open-ticket)

But, I see you submitted one for something similar. Please let me know. Thanks.
