Question

Is it possible to encrypt/decrypt smaller segments of a file for HTTP Live Streaming, with industry-standard encryption techniques such as PlayReady and AES-128?

I don't know how the default HLS implementation in iOS works with AES-128 encryption - i.e, is it still able to download partial segments (TS) and stream files progressively? Or does it have to download the full file, decrypt the entire contents and only then start playback?

In some PlayReady clients I've been exposed to, I've observed the latter approach (download in full first). But it seems like an awful compromise on playback latency, to attain security (and perhaps there is no way around it).

Some light on this subject would be very helpful. Thanks!


P.S: References to technical documentation or manuals would be great!

Was it helpful?

Solution

AES works a block cipher with a block size of 128 bits. So if the decryption program knows the key and the IV, it can return plaintext from the first block -- there's no reason to decrypt an entire segment/fragment first.

I'm guessing the PlayReady implementations you see are only doing it on a file basis because that is slightly easier to implement. But there's no technical reason that a client would need to retrieve the entire file before initiating the decryption.

You can verify what a client is doing by making a fragment/segment extremely large and checking client behavior.

A quick search found me this project which is decrypting HLS as it reads: https://code.google.com/p/mlbtv-hls-nexdef/source/browse/trunk/mlb.c

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top