Patrickz
Patrickz

Reputation: 760

How to use Wowza HLS AES-128 by dynamic key

How to config Wowza Streaming Engine to use HLS-AES128 with dynamic key? Is it possible?

Upvotes: 0

Views: 498

Answers (1)

aergistal
aergistal

Reputation: 31219

It's possible with the Server Side API. There are two callbacks:

  • onHTTPCupertinoEncryptionKeyVODChunk
  • onHTTPCupertinoEncryptionKeyLiveChunk

Example from the documentation:

public void onHTTPCupertinoEncryptionKeyLiveChunk(ILiveStreamPacketizer liveStreamPacketizer, String streamName, CupertinoEncInfo encInfo, long chunkId, int mode)
{
    if (streamName.equals("myStream"))
    {
        encInfo.setEncMethod(CupertinoEncInfo.METHOD_AES_128);
        encInfo.setEncUrl("http://mycompanykeyserver.com/authenticate.aspx");
        encInfo.setEncKeyBytes(BufferUtils.decodeHexString("123456789ABCDEF123456789ABCDEF12"));
        encInfo.setEncIVBytes(BufferUtils.decodeHexString("FEDCBA9876543210FEDCBA9876543210"));
        encInfo.setEncKeyFormatVersion("1");
    }
}

Rotation is achieved by changing the key. Note that you shouldn't do this for each segment. You have to change the above example and choose your window.

See: On-the-fly encryption with Wowza server-side API

Upvotes: 1

Related Questions