在播放的iOS加密MP3

编程入门 行业动态 更新时间:2024-10-27 00:34:34
本文介绍了在播放的iOS加密MP3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有加密的MP3文件的一个AES,我需要在iOS的发挥;我不能将文件解密到磁盘出于安全考虑,我可能无法将其解密到内存中,由于内存限制。

I have an aes encrypted mp3 file that I need to play in iOS; I can't decrypt the file to disk for security reasons, and I likely can't decrypt it to memory because of memory constraints.

有直接播放加密文件,或者将其传输到播放器,而无需加载所有到内存中的方法吗?我在这一个一个的损失感到非常,我甚至不知道从哪里开始...我使用AVAudioPlayer播放的文件,但我猜它不够灵活,不能做我想做的。

Is there a way to play an encrypted file directly, or to stream it to the player without loading it all into memory? I am really at a loss with this one, I don't even know where to begin... I'm using AVAudioPlayer to play files, but I'm guessing it's not flexible enough to do what I want.

推荐答案

我不知道怎么AVAudioPlayer工作,但要解决这个问题的唯一方法是提供某种抽象,玩家可以访问的。如果玩家只能访问文件的对象,你的运气了,并且必须使用另一个球员。如果玩家能获得某种形式的输入流(我怀疑它可以),您可以创建文件(称之为文件流)流,并创建文件流解密流。你必须了解AES加密仅在只要你将需要使用一个已经存在(如加密++)code创建解密流。

I don't know how AVAudioPlayer works, but the only way to solve this problem is to provide some sort of abstraction that the player can access. If the player can only access "file" objects, you are out of luck and must use another player. If the player can access an input stream of some sort (which I suspect it can), you can create a stream from the file (call it a "file stream"), and create a decryption stream from the file stream. You will have to understand AES encryption only in so far as you will need to use code that already exists (like crypto++) to create a decryption stream.

在psuedod code,它会是这个样子:

in psuedodcode, it would look something like this:

filestream fs = new filestream( path ) decryptionstream ds = decryptionstream( fs, decryptionkeydata ) AVAudioPlayer.open( ds ); AVAudioPlayer.play()

在内部,AVAudioPlayer会读取来自decryptionstream,它将从文件流,它将从文件中提取数据提取数据的数据块。个数据将在decryptionstream被解密,一个块在时间

Internally, AVAudioPlayer will read chunks of data from the decryptionstream, which will pull data from the file stream, which will pull data from the file. Th data will be decrypted in the decryptionstream, one chunk at a time.

更多推荐

在播放的iOS加密MP3

本文发布于:2023-11-23 15:37:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621978.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!