samdutton / simpl

Simplest possible examples of HTML, CSS and Javascript:
https://simpl.info
Apache License 2.0
5.18k stars 1.64k forks source link

ClearKey conversion #117

Closed techterbium closed 6 years ago

techterbium commented 6 years ago

Hello @samdutton , please bear me for my newbie question.

Intention: encrypt an mp4 video using webm_crpty using clear key and play it in browser.

I have been following your article here and encrypted content is created using link here.

Video details: Video type : webm Codec : VP80

My Question: If I had encrypted the video using the same key as in example (i.e. 0123456789012345), what would be my Uint8Array values?

In your example, it is as below:

var KEY = new Uint8Array([ 0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b, 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c ]);

how can I convert 0123456789012345 into something like above? Your help is very much appreciated. Thank you.

samdutton commented 6 years ago

Hi @techterbium

Thanks for the question!

I haven't worked on EME for a while — I think your best bet is to check out at the demo at bit.ly/pwa-media), its source code and the accompanying Developer Diary series.

techterbium commented 6 years ago

Hi @samdutton , thank you very much for taking time to reply.

I know you left eme behind you, but I believe, the response that I am looking for is very trivial for you.

I am trying to replicate your clearkey example with my own encrypted video (which is created using webm_crypt as per this doc

I am really having hard time to construct octet sequence array of contents of key file generated out of webm_crypt command.

Once again, sorry for repeating my question, but I am really helpless here as there is very little support on this subject over internet. Your response might save many hours of mine. please.

Here is the .key file generated in my case. (renamed to .txt to get it attached here). How would I get the octet sequence you used in your program? please advice here. bear2_64.txt