5

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.

Prateek Negi
  • 97
  • 1
  • 1
  • 7

1 Answers1

12

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.

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

Abdul Rehman
  • 2,313
  • 2
  • 15
  • 14