在 Adobe AIR 中加密资源(视频文件)
我正在尝试在 Adobe AIR 中创建视频播放器。我想加密视频文件,以便它们不能在播放器之外共享。我不想通过重重困难来创建一个坚如磐石的系统,但只是简单地创建一些只会阻止 90-95% 的用户共享内容的系统。
但是,由于视频文件大小肯定会超过 10 MB,因此上述方法似乎不是解决方案。
有许多加密文本字符串的解决方案,但我还没有找到任何加密文件的解决方案。任何帮助或指示将不胜感激。
非常感谢。
更新:我们正在尝试通过以下方式实现这一目标:
- 加密/混淆视频文件的前 50 个二进制字符并存储在硬盘上。这使得该文件无法播放。
- 在运行时解密前 50 个字符以获取原始文件并将其复制到硬盘驱动器上的临时文件夹中。
- 退出时,删除解密的文件并清空临时文件夹。
这解决了我们的大部分问题。它不允许通过简单的复制和粘贴进行共享。是一个简单的解决方案,尽管可能不是很优雅。
我们现在面临的问题是临时文件夹没有被清空。该文件会出现在回收站中,并且可以轻松地从那里恢复!
I am trying to create a video player in Adobe AIR. I want to encrypt the video files so that they are not sharable outside the player. I don't want to jump through hoops to create a rock-solid system but something simple that just prevents 90-95% of the users from sharing the content.
I have been through a related question on SO at File Protection in Adobe AIR (Flex)
However since the Video file size would definitely exceed 10 MB, the above does not seem to be the solution.
There are a number of solutions to encrypt text strings but I have not found any that encrypt files. Any help or pointers will be appreciated.
Many thanks.
Update: We are trying to achieve this in the following manner:
- encrypt/jumble the first 50 binary characters of the video file and store on the hard drive. this makes the file unplayable.
- on runtime decrypt the first 50 characters to get the original file and copy it in a temp folder on the hard drive.
- on exit, delete the decrypted file and empty the temp folder.
this solves most of our problems. It does not allow sharing by simple copy and paste. Is a simple solution, though maybe not very elegant.
The problem we are facing now is that the temporary folder is not getting emptied. The file lands up in the recycle bin and can be easily recovered from there!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我通过 DVD 应用程序解决了这个问题,加密了 DVD 中的所有资源,并在 AIR 应用程序中执行 HTTP 服务器来解密它。
它的工作方式如下:
1 - 图像、视频或资产被加密并保存在任何地方,在我们的例子中是带有主密钥的 DVD 资产文件夹。
2 - Air 应用程序内部包含一个非常简单的 HTTP 服务器,该服务器读取文件并对其进行解密,然后仅使用简单的 Flash 视频播放器或使用
Air 应用程序内部用于提供文件服务的代码如下:
我们使用 RC4 算法,因为它在我们的测试中速度更快。
对于 HTTP 服务器,我们使用了 Flash Camp 2010 中的示例 http 应用程序,您可以在 google 中找到它。
问候
--
www.imaginacolombia.com
I solved this for a DVD application encrypting all the assets in the DVD and executing a HTTP Server inside the AIR application that decrypts it.
It works in this way:
1 - The images, videos, or assets are encrypted and saved anywhere, in our case the DVD assets folder with a master key.
2 - The Air application contains inside a very simple HTTP server who reads the file decrypts it and send it only to the same Air application using a simple Flash Video Player or using a tag like
<img src="localhost:5050/assetcode.jpg">
The code used inside the air application to serve the file is like:
We use the RC4 algorithm because it's the faster in our tests.
For the HTTP Server we used a sample http application from the Flash Camp 2010, you could find it in google.
Regards
--
www.imaginacolombia.com
您所描述的是“数字版权管理”,AIR 确实支持这种功能,您可以在此处阅读更多相关信息:
http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118676a5be7-8000.html
DRM 如今是一个棘手的问题,因此,您可能需要考虑一下您是否真的需要 DRM,或者是否可以不需要它。
What you're describing is 'Digital Rights Management', and AIR does support this kind of thing, which you can read more about here:
http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118676a5be7-8000.html
DRM is a thorny issue these days, so it might be worth considering whether you really need DRM or whether you can do without it.
当文件以 PHP 或其他脚本语言下载时,您可以验证文件吗?您可以强制 SWF 要求通过 post 或其他方式传递参数(但是未经测试),而大多数其他播放器不会这样做......
然后您可以使用以下命令减少推送文件的服务器上的服务器负载http header X-sendfile 或类似的等效...
Can you authenticate the files when the files are downloaded in PHP or some other scripting language? You could force the SWFs to require a parameter to be passed in via post or something (untested however), which most other players wouldn't do .....
You could then reduce the server load on the server pushing the file using the http header X-sendfile or a similar equivalent ...
您可以执行的操作是:
(1) 读取文件的前 1000 个字节。
(2) 将这 1000 字节存储在加密的 sqlite 数据库或加密的 LocalStore 中。
(3) 将 1000 个空字节写入文件开头。
到目前为止,如果双击该文件将无法打开。虽然大部分数据还在,但大多数人都会放弃。
当您需要该文件时:
(4)检索存储的1000字节并
(5) 将它们写回到文件的开头。
完成后,重复步骤 1-3。
What you could do is:
(1) Read the first 1000 bytes of the file.
(2) Store those 1000 bytes in an encrypted sqlite database, or the Encrypted LocalStore.
(3) write 1000 empty bytes to the beginning of the file.
By now, the file will not open if you double click it. Although most of the data is still there, most people will have given up.
When you need the file:
(4) Retrieve the stored 1000 bytes and
(5) Write them back to the beginning of the file.
When finished, repeat steps 1-3.