Android中视频文件的加密和解密

Android中视频文件的加密和解密

本文介绍了Android中视频文件的加密和解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我如何从服务器下载视频文件并在应用程序中播放时解密视频文件吗?请帮忙.谢谢.

Can anyone please tell me how to encrypt video file while downloading from the server and decrypt it while playing inside the app? please help. thank you.

推荐答案

使用 CipherOutputStream CipherInputStream 用于android中文件的加密和解密.

Use CipherOutputStream and CipherInputStream for encryption and decryption of file in android.

有两种方法可以实现目标

There are two ways through which you can achieve your goal

要播放该文件时,请下载文件并对其进行加密,然后将其解密以将其存储在临时文件中并进行播放.

Download a file and encrypt it, when you want to play that file decry-pt it in a temporary file and play it.

如果您想动态播放加密文件(而不是在临时文件中解密),则可以使用 Libmedia 库.它将加密的文件流式传输到本地主机上,然后从本地主机上播放

if you want to play encrypted file on the fly (not decrypting it in a temp file) then you can use Libmedia library. It streams encrypted file on local host and play it from there

这篇关于Android中视频文件的加密和解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 22:46