Encrypt large files on flutter and access them only through in-app

Viewed 1325

I am developing a digital media app using Google's flutter framework which contains songs, movies and etc. The main focus is, these media content should be accessible only through the app and not by outside methods (eg: media players, file browsers).

Eg: A music file which was downloaded through the app should only be played within the app and not by any media player. In that case, there should be an encryption method which should be used to lock these files from outside world.

In this case, bigger files such as Movies should also be taken into consideration. The size of a file can be anywhere between few kbs to 2-3 GBs.

What should be the better approach when solving this problem?

Is it to

  • Store everything in a database after encrypting the bytes?
  • Encrypt the entire file and still keep them in the form of "file"?

The downloaded data should also be able to be consumed quickly once the user requested for it. And once the consume is done, the file should be locked again from the rest of the world.

I am not sure if this topic is too broad but somehow I would appreciate it if anyone could provide me with something to start off.

Thank you.

0 Answers
Related