cd1daf5b by David LaPalomento

Add info on creating encrypted bytes

Make a document with an explanation of how to create test encrypted data from the command-line.
1 parent bf982b0b
1 # Encrypted HTTP Live Streaming
2 The [HLS spec](http://tools.ietf.org/html/draft-pantos-http-live-streaming-13#section-6.2.3) requires segments to be encrypted with AES-128 in CBC mode with PKCS7 padding. You can encrypt data to that specification with a combination of [OpenSSL](https://www.openssl.org/) and the [pkcs7 utility](https://github.com/brightcove/pkcs7). From the command-line:
3
4 ```sh
5 # encrypt the text "hello" into a file
6 echo -n "hello" | pkcs7 | openssl enc -aes-128-cbc > hello.encrypted
7
8 # encrypt some text and get the bytes in a format that can be easily used for
9 # testing in javascript
10 echo -n "hello" | ~/Projects/pkcs7/lib/cli.js | openssl enc -aes-128-cbc | xxd -i
11 ```
12
13 Later, you can decrypt it:
14
15 ```sh
16 cat hello.encrypted | openssl enc -d -aes-128-cbc
17 ```