1

I have a video (say clip.mp4 or clip.webm) which I need to play on the html5 video tag () Now I have obfuscated the first few bytes of clip.mp4 (basically applied a simple XOR function).

Now can I de-obfuscate (as in apply an XOR on the XOR'ed bytes) in Javascript and give the clip to the video tag?

Does JavaScript currently provide the capability to do that? If so, what should I do? What are the general directions I should follow in order to get this working?

I came across a cross platform compiler called Emscripten. Quoting from their site : "Emscripten is an open source LLVM to JavaScript compiler. With it, you can compile C and C++ code into JavaScript and run it on the web" Can this do the job? What steps do I have to take to get this running?

S.Raaj Nishanth
  • 242
  • 2
  • 15
  • Hardly, I think - the video stream is going to be outside JavaScript's control. It's a nice idea for protecting content at a basic level, but it'll probably turn out to be too efficient :) – Pekka Jan 23 '13 at 12:00
  • The video stream might be outside of JavaScript's control. But can a C++ code that has been compiled into JavaScript do the trick? Emscripten allows the capability to cross-compile c/c++ into JavaScript. But i'm not really sure if that's the direction to take or if i'm way off track!! :-| – S.Raaj Nishanth Jan 23 '13 at 12:04
  • You are talking about browser-side Javascript, right? Then you're way off track. :) There's no way to run any kind of compiled code in browser-side JavaScript. You'd need to build a browser extension for that. – Pekka Jan 23 '13 at 12:07
  • @S.RaajNishanth If you have the un-obfuscated video clips and need to play them, then why would you go through the trouble of obfuscating them and making something to de-obfuscate them?? – rink.attendant.6 Jan 23 '13 at 12:08
  • @Pekka웃 : Yes i'm talking about browser-side Javascript – S.Raaj Nishanth Jan 23 '13 at 12:23
  • @rink.attendant.6 : Just to add in some video security, to protect the videos from being downloaded and played elsewhere! – S.Raaj Nishanth Jan 23 '13 at 12:23
  • 1
    @S.RaajNishanth See http://stackoverflow.com/questions/2983555/is-there-a-way-to-use-drm-on-html5-video – rink.attendant.6 Jan 23 '13 at 12:24

0 Answers0