Reputation: 142
I'm trying to find a secure way to view an encrypted stream using hls.js
.
One way I thought of was to have the stream playlist without the EXT-X-KEY
tag and append it on load and then feeding the resulting blob as a URL to the hls.js
initialiser. But I got concerns from other dev that this way the blob is going to be cached and could be extracted along with the key.
Is there a way to securely provide the hls.js
with the key as binary and avoid caching?
Upvotes: 0
Views: 1672
Reputation: 8264
Encryption makes the HLS package unreadable if you don't have the key.
Digital Rights Management (DRM) is responsible for the secure key exchange and the licensing.
Your browser handles the secure key exchange inside the Content Decryption Module.
So what you need is a DRM system. It looks like hls.js only supports Widevine. This looks like a good summary Widevine DRM: https://www.vdocipher.com/blog/widevine-drm-hollywood-video/
Upvotes: 1