-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieving AES-128 Decryption Key Dynamically #6803
Comments
To return a custom result, you need to create a custom loader. Extending the XHR loader allows you to override the load method and evoke a successful callback with any payload. https://github.com/video-dev/hls.js/blob/v1.5.0/docs/API.md#creating-a-custom-loader |
@robwalch First, thanks for your quick answer. Well, I tried to implement my own loader, but I went into issues regarding xhr requests, as they always get sent without the needed JWT token ... It appears that as soon as I use my own loader, xhrSetup does not get configured anymore, see my code above. I can also not use a loader in combination with the code I showed above, so how can I use my own loader and my own xhr request setup both at the same time? Do I have to implement everything myself inside my own loader ? Thanks in advance |
You can set request headers and hls.js/src/utils/xhr-loader.ts Lines 86 to 126 in 2d91f78
XhrLoader , call super() in the constructor, and call load or loadInternal to start loading.
|
What do you want to do with Hls.js?
Hello,
I would like to inquire about the dynamic retrieval of an AES-128 decryption key. In the following scenario, is there a way to achieve this?
Currently, I overwrite the URL when it contains kms://, which references the key_id in my .m3u8 playlist. While this functionality is working well, I also need a method to pass the AES-128 key to HLS.js. Is it possible to request the decryption key from a WASM binary and then return it to HLS.js?
Proposed Idea:
This approach focuses solely on exchanging static AES-128 keys and does not involve EME/DRM/Widevine. My goal is to implement a protection mechanism that is a bit more complex than a simple static key exchange. Since I already have the WASM code for secure key exchange, I need assistance in passing the received Uint8Array back to HLS.js. Any Idea?
I'm aware that this does not bring the same protection as a real DRM, but still would make it quite hard to dump the decryption key from memory once it has been exchanged.
Thank you for your help!
What have you tried so far?
No response
The text was updated successfully, but these errors were encountered: