Qiniu cloud storage-how does qiniu phpSDK encrypt HLS?

Source: Internet
Author: User
The php sdk is used. How can I encrypt videos with HLS? For more information, see hlsKey base64_urlsafe. What is hlsKeyUrl? How does PHP generate the hlsKeyType encrypted by rsa oa ep? Developer. qiniu. comdocs... the php sdk is used. How can I encrypt videos with HLS?

Refer to the following,hlsKeyIt is base64_urlsafe. This is easy to understand,hlsKeyUrlWhat is it? How does PHP generate an rsa oa ep encryption method?hlsKeyTypeWhat about it?

Http://developer.qiniu.com/docs/v6/api/reference/fop/av/segtime.html

Hls Encryption

Hls encryption is to use the AES-128 bit to encrypt each ts file, the player in obtaining PlayList file, will according to the # EXT-X-KEY tag inside the request to obtain the decryption URL, and then request to decrypt the key, the obtained ts file will be decrypted with the key. Users can perform cookie verification on the URL of the key and other methods to authenticate the user. Example: PlayList file (copy the link to view the file content or play it directly with the vlc player)

Parameter description:

  • hlsKeyBase64_urlsafe encoding or encrypted key
  • hlsKeyUrlSpecifies the url of the key, which is base64_urlsafe encoded. This is used to generate m3u8 PlayList.
  • hlsKeyTypeSpecifies the method for transferring the key.

    • If this parameter is not specified or 0 is specified, it is transmitted only in base64_urlsafe encoding mode.
    • Specified as 1.x( 1.0, 1.1 ,...), The encryption method of rsa oa ep is used to transmit the key by encoding. x indicates the version of the key.
    • Public Key: 1.0

Reply content:

The php sdk is used. How can I encrypt videos with HLS?

Refer to the following,hlsKeyIt is base64_urlsafe. This is easy to understand,hlsKeyUrlWhat is it? How does PHP generate an rsa oa ep encryption method?hlsKeyTypeWhat about it?

Http://developer.qiniu.com/docs/v6/api/reference/fop/av/segtime.html

Hls Encryption

Hls encryption is to use the AES-128 bit to encrypt each ts file, the player in obtaining PlayList file, will according to the # EXT-X-KEY tag inside the request to obtain the decryption URL, and then request to decrypt the key, the obtained ts file will be decrypted with the key. Users can perform cookie verification on the URL of the key and other methods to authenticate the user. Example: PlayList file (copy the link to view the file content or play it directly with the vlc player)

Parameter description:

  • hlsKeyBase64_urlsafe encoding or encrypted key
  • hlsKeyUrlSpecifies the url of the key, which is base64_urlsafe encoded. This is used to generate m3u8 PlayList.
  • hlsKeyTypeSpecifies the method for transferring the key.

    • If this parameter is not specified or 0 is specified, it is transmitted only in base64_urlsafe encoding mode.
    • Specified as 1.x( 1.0, 1.1 ,...), The encryption method of rsa oa ep is used to transmit the key by encoding. x indicates the version of the key.
    • Public Key: 1.0

Php call persistent processing (Audio and Video Processing) documentation can refer to the http://developer.qiniu.com/docs/v6/sdk/php-sdk.html#av-hls

To encrypt the slice, you only need to modify$fopsValue, suchavthumb/m3u8/segtime/10/hlsKey/ /hlsKeyType/ /hlsKeyUrl/

  1. The plaintext is 16 bytes. Use the Public Key provided by qiniu and the following command to encrypt the plaintext:
$ echo -n [AES128KEY] | openssl rsautl -encrypt -oaep -inkey [QINIU_PUB_KEY_FILE] -pubin | openssl base64 -A | tr "+/" "-_"
  1. If The value is the base64 encoding of the plaintext key. The value is 0. If The value is the ciphertext encrypted by the qiniu public key. The value can be 1.0 characters.

  2. Fill in the plaintext address of the key, which is generally the address of your business server, and control the access permission to this url through the Business server process.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.