AES-128 Encryption

In order to enable AES-128 encryption you need to add the following object into your job query:

"encryption" : {
  "key" : "12345678901234567890123456789012",
  "iv" : "e3bb37322f1b3a1d16e068555e3a344b",
  "key_url" : "https://your-server.com/aes-128/encryption.key"
}

Please take a look at full query sample below:

{
  "query": {
    "source": "https://your-server.com/video.mp4",
    "format": [
      {
        "output": "advanced_hls",
        "destination": {
          ...
        },
        "encryption" : {
          "key" : "12345678901234567890123456789012",
          "iv" : "e3bb37322f1b3a1d16e068555e3a344b",
          "key_url" : "https://your-server.com/aes-128/encryption.key"
        },
        "stream": [
          {
            "size": "640x360",
            "audio_bitrate": "128"
          },
          {
            "size": "852x480",
            "audio_bitrate": "128"
          },
          {
            "size": "1280x720",
            "audio_bitrate": "320"
          },
          {
            "size": "1920x1080",
            "audio_bitrate": "320"
          }
        ]
      }
    ]
  }
}


The process of key and IV creation using openssl is described below:

1
Generate random 128-bit value in binary format:

openssl rand -out key.bin 16

Place the resulting file to your web-server and provide url for it in key_url field.

2
Convert your key from bin to hex mode:

xxd -p key.bin >key.hex

Specify result as a value for key field.

3
Generate initialization vector in hex:

openssl rand -hex -out iv.hex 16

Specify result as a value for iv field.