iphone - iPhone HTTP 流的 AES 128 加密

标签 iphone streaming aes encryption

我对密码学几乎一无所知,但我想弄清楚如何加密 HTTP 直播流并在 iPhone 上解密。

Apple 文档中关于 HTTP 加密的内容如下:

Media files containing stream segments may be individually encrypted. When encryption is employed, references to the corresponding key files appear in the index file so that the client can retrieve the keys for decryption.

When a key file is listed in the index file, the key file contains a cipher key that must be used to decrypt subsequent media files listed in the index file. Currently HTTP Live Streaming supports AES-128 encryption using 16-octet keys. The format of the key file is a packed array of these 16 octets in binary format.

The media stream segmenter available from Apple provides encryption and supports three modes for configuring encryption.

The first mode allows you to specify a path to an existing key file on disk. In this mode the segmenter inserts the URL of the existing key file in the index file. It encrypts all media files using this key.

The second mode instructs the segmenter to generate a random key file, save it in a specified location, and reference it in the index file. All media files are encrypted using this randomly generated key.

The third mode instructs the segmenter to generate a random key file, save it in a specified location, reference it in the index file, and then regenerate and reference a new key file every n files. This mode is referred to as key rotation. Each group of n files is encrypted using a different key.

You can serve key files using either HTTP or HTTPS. You may also choose to protect the delivery of the key files using your own session-based authentication scheme.

使用加密方法1,这是我认为我需要做的:

  1. 使用密码生成 key ,并使 key 可供分段器使用
  2. 分段器将 key 的 URL 插入索引文件
  3. 将此密码存储在 iPhone 中(钥匙串(keychain)?)
  4. 将电影播放器​​指向引用此索引文件的 m3u8 播放列表的 URL
  5. 以某种方式输入密码以自动解密流?

有人可以帮助解除这里的迷雾吗?

最佳答案

这几乎说明了如何处理加密流:

http://developer.apple.com/iphone/library/qa/qa2009/qa1661.html

此外,应用程序应在运行电影之前连接到 https 域, 以便它可以传递其凭据,并且可以缓存这些凭据 MPMoviePlayer。

播放器支持摘要身份验证,但不支持使用 SSL 客户端身份验证 客户证书。

关于iphone - iPhone HTTP 流的 AES 128 加密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2312145/

相关文章:

iphone - 如何删除 UITextView 底部的空格?

iphone - NSMutableURLRequest 继承另一个 NSMutableURLRequest 的成功

iphone - 呈现 UIViewController 作为 tableViewCell 的详细 View 后错误解雇

使用 AES 的 Java 卡加密返回 6F00

iphone - 是否可以在 iOS 应用程序中使用 rsync?

video - 如何使用 ffmpeg 从网络摄像头访问压缩流

ios - 从 wowza 服务器播放视频到 ios 设备

java - 视频流背后的基本概念

java - (AES加密)代码缺陷,应该注意什么? [提供代码][Java]

java - 我在解密使用 RSA 生成的公钥 (.jks) 编码的 128 位 AES key 时遇到 BadPaddingException