Ok, I have a video encrypted through AES, stored in the internal memory of an Android powered device. What i want is that the video should only be played through an android app.
It would be appreciated if that application would decrypt the video part by part, store it in a virtual memory, and then stream it.
My question:
Is it possible to decrypt it part by part and stream?
If Yes, what would be the basic process?
If No, (nothing is impossible to code)
To make it happen, do i need to design my own video player android app, or can i use some existing app to work inside my app?
This subject is already treated in many questions.
For instance, look at How to play an encrypted video file in Android
Related
While uploading the videos/audio files from my application,mostly i followed the following ways,
Record the file (video/audio)
Save into Internal/External Storage (inside application folder)
Then upload in server.
here my question is, whether its possible to save directly in the server (Amazon s3 or others). Why i'm asking this, while i using Periscope application they streaming the video as well as stored the video in their server.
Checkout LibStreaming : https://github.com/fyhertz/libstreaming or some of the suggestion in : Streaming video from Android camera to server
You can see this github or use ffmpeg
I think that it all depends on the importance of your video. When you use your original approach you guarantee that you have the full video in hand (device) and you can make sure it will be fully uploaded to your server. On the other hand, streaming it directly to the server can make you lose frames (connectivity hiccups and such) and hurt the video. I'm sure that streaming is done using UDP which makes loosing packages a really good option.
I want to play encrypted video files present on my device after decrypting them. I want to pre-process the data-stream and parallel play it using videoview like streaming video from Internet.
Is there any way I could buffer the processed data to videoview like a network stream ?
I think you are saying that you want to decrypt the video in one process and then pass the decrypted 'clear stream' video to another process to play it?
If the video is DRM protected, then your use case is very unlikely to be supported by any of the leading DRM solutions - they go to great lengths to ensure the clear stream video is not accessible by an application on the device (for obvious reasons).
If you are using or a simple encryption with the encryption key available to your application then you should be able to do this.
Update
Answering BMvit's question in the comment - one way is to follow these steps:
Stream the encrypted file from the server as usual, 'chunk by chunk'
On your Android device, read from the stream and decrypt each chunk as it is received
Using a localhost http server on your Android device, now 'serve' the decrypted chunks to the MediaPlayer (the media player should be set up to use a URL pointing at your localhost http server)
I am guessing this is the most likely the approach that the libMedia library uses, although I have never seen the source so I could not say for sure: http://libeasy.alwaysdata.net
It is worth being aware that this is tricky (which is probably why LibMedia is not free).
I searched through a lot of questions on SO but I can't find the answer, that's why I ask the following question:
An Android app should be able to play an encrypted video file (stored on the SD card and retrieved from a webserver).
The file has to be stored on the SD card so that the app can play the video file without having an active internet connection.
Because the video files may not be copied, the plan is to encrypt them server side when uploading the files to a webserver.
What is the best option?
1) I have seen suggestions for running a local webserver which decrypts the file (and how to do this?)
2) or should we decrypt the file, save it as a temporary file and set this temporary file as the source for the videoplayer?
3) something completely different?
You are trying to implement a DRM scheme, and a naive one at that. Look into DRM schemes and report back if you cannot implement the impossible. All you can hope for is obfuscation, and there are plenty of ways of doing that (none of them are secure of course).
What you need is DRM. Digital Rights Management (DRM) controls the access to your digital content such as video. Firstly, you need to encrypt the video with an encryption video like AES-128. Then with the use of DRM play in exoplayer. Exoplayer has DRM support. you can check here. https://exoplayer.dev/drm.html
You will expose the user to a waiting time if you choose to decrypt a entire big video beforehand. As of the security, you can guess it's a poor idea to have the contents in clear in a file, even temporary. The local webserver is a better choice because it's a streaming method, so without file storage. There is no class for an http server in the SDK, you have to implement your own one, otherwise look for an existing library similar to LocalSingleHttpServer.
i am developing one android application. it download videos from server and store it in mobile.
i want to store those video in secure manner.(deny the user from copying. or deny them from viewing the video directly from sdcard)
i found two ways to solve the problem.
1)Store the video's inside the application.
2)Encrypt the entire video
but facing some problem in implementing solution
i)first solution found suitable. but i am fearing that. if we store too much video inside the application .it would become bulkier.and fore the user to uninstall.
ii)but in second solution. i did not find any correct way to do so.
so please help me to solve the problem.
This is kind of suggestion :
To store the videos you must have created some folder on SDCARD, so you can hide the folder by putting the "." in front of the name while creating it. on top of this you can encrypt the video file using AES algorithm so it can not be viewed, if copied outside the android it will not be view able. but from your application you can decry-pt the file and view it.
Definitively, you must encrypt the media and that's quite simple. What is more difficult is to play the media, because MediaPlayer only accepts clear contents. A basic way would be to convert an encrypted file to a decrypted one, just for the time of the playing session. A better approach is to build a stream from the file, decrypt that stream and feed it to the player. The hard point is to have a local http server to serve the stream.
Im presently working on an android application which will allow the user to download video and audio content from a server and play them on the phone of the end user.
What I'm trying to do is to secure the audio and video. The files should not be accessible to other applications and the user must not be able to take them off the device and use them.
This is a shot in the dark but can i do this by storing the videos in theSQLLite database as blobs.
And also is it possible to play the videos in android if they are stored as blobs.
I wouldn't use blobs, they are only performant if the binary-files are 256KB or less.
I guess the only way to make the videos secure so the user can't use them is to stream them down from you'r server and deleting the buffer when the Application closes.
On a rootet Device, you have access to every directory, so you can't save the videos on the SDcard or the Phone-Memory.