title: Issue with openssl aes-128 encryption for Apple's HTTP Live Streaming
body: <p>We are using <code>openssl aes-128 encryption</code> for streaming media on <code>HLS video streaming</code> for Apple. </p>
  
  <p>Below is the command used for the <code>aes-128 encryption</code></p>
  
  <pre><code>openssl aes-128-cbc -salt -k &lt;HEXKey&gt; -iv &lt;HEXIV&gt; -in &lt;INFILE&gt; -out &lt;OUTFILE&gt;
  </code></pre>
  
  <p>And below in my <code>Playlist / Index</code> File being used for hls streaming.</p>
  
  <pre><code>#EXTM3U
  #EXT-X-MEDIA-SEQUENCE:0
  #EXT-X-ALLOW-CACHE:NO
  #EXT-X-VERSION:2
  #EXT-X-KEY:METHOD=AES-128,URI="http://xxx.xxxx.xxx/key.txt",IV=0x00000000000000000000000000000000
  #EXT-X-TARGETDURATION:10
  #EXTINF:10,
  http://xxx.xxxx.xxx/encry.ts
  #EXT-X-ENDLIST  
  </code></pre>
  
  <p>Where , <code>key.txt</code> contains the hex key as of form <code>0x00000000000000000000000000000000</code>.</p>
  
  <p>But this is not working and not playing media on <code>IOS</code> device. provides error as <code>This movie could not be played</code></p>
  
  <p>I am not sure , what is wrong in it. Is this issue of <code>encryption method</code> or <code>playlist file</code></p>
  
  <p>Please help me. I'll Appreciate.</p>
  
  <p>Thanks in Advance </p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>I Felt , below few information, may help if anything wrong in that.</p>
  
  <p>Below is command I use for creating hex <code>key</code> and <code>IV</code></p>
  
  <pre><code>openssl enc -aes-128-cbc -k String@MyKey -P -md sha1
  </code></pre>
  
  <p>Please help me if anything wrong with it. </p>
  
  <p>now my playlist file parsing fine with <code>Media Stream Validator</code> , but while validating media it gives below error.</p>
  
  <pre><code>unable to parse segment due to encryption
  </code></pre>
  
  <p>Please help anybody. </p>