Encrypting the Video file in SD-CARD in react native - javascript

I was able to successfully encrypt and decrypt the videos using AES encryption. It worked good for smaller videos while for the bigger files it gave us the memory out/Overflow exception. Is there a better way to safe guard the video files where only my application can have the access to it.
I am using this library "node-forge"
How are Video streaming apps like Netflix and Amazon prime are securing the videos locally, which are accessible only through their apps. If they are decrypting the whole file, how is the process so fast?
I was just wondering if we can just corrupt the file and de-corrupt while converting to base-64 ?
EDIT:
This is a E-learning application where videos are accessed through SD Card securely. These Videos should be secured and can be played in only our app.

You need to design your security measures based on your requirements which is a very complex process and you need to consider a lot of details. In one hand you need to design a suitable protocol for your application, and in the other hand you should try to make it secure.
As suitability of design, for example, you need to consider how you are going to playback your video or how much disk/memory you have. In cases like Netflix which they playback video while downloading, they they probably use streaming modes of encryption algorithms. But As I said, without understanding complete design of your application, suggesting encryption methods is somehow unethical.
Update:
If a simple encryption is what you need, I suggest you to use a streaming method(like CTR). In this case, you can decrypt your content on-fly rather than completely decrypting your files first. But you need to feed this content into your player. This may be a little problem if you have not written your own player. I did this once by hooking file read/write APIs and did similar thing that you need, so it is possible.

As you have said that you have successfully encrypted the smaller video files with AES, i will suggest you to break down your all files into small chunks (for example 512kb/1Mb parts file1.part1 or even give custom names so your app only knows which is part 1,2 and so on) and then encrypt each. During the decryption process decrypt each one after other to get the whole file or if you can create custom player do this on-the-fly.

Related

How Video streaming is implemented in popular online education websites

I need to build a web based video player. Something like coursera/udemy. I would like to know the following.
Where we can store videos (Blob,Db..etc)?
Say I uploaded video in Blob storage. How can I make sure nobody is able to download this videos?
What should be an ideal video streaming architecture(BE+FE) if I am expecting 500 concurrent users?
Do I really need to build a video streaming Back End or I can simply use services like vimeo to get this done?
I inspected how Udemy is doing, i could find the following. It looks like they are using some blob to store videos. But when I tried to access this directly it says I cannot. How this works?
There can be no way to protect your video from a determined sophisticated hacker. In the very worst case, they can record the video from their screen using a iPhone.
You can learn more about blob: URL e.g. here. The bottom line: it's a browser-side object, it's not to store videos.
You definitely can use streaming services, but this will even further reduce your control. OTOH, it's not worth your effort to develop some new streaming architecture if you only expect 500 concurrent streams.

How to grant access to audio files without downloading

I want to grant access to audio files for some group of people - now in the browser but in future in Ionic / Cordova app as well. But Access to them will be after authentication and I want to protect against downloading them.
What will be the best way to do it?
put files to some service for audio files - similar to youtube?
streaming from server - I use PHP?
use flash app?
Thanks for any solutions,
Similarly, to video files you can't prevent someone form downloading a file if you want to stream it to their device.
Ultimately, the file has to get to the device and there are many ways to store it even if you try to make it hard.
The usual approach to take is to DRM protect the files - this is commonly used by the paid music services.
Audio DRM is a little different from video, because most devices do not have a secure media pipeline for audio, which means it is a little less secure.
Ultimately, all these measures are hurdles and detergents - it generally ends up being as much a business solution as anything. If the user perceives that the cost is not too high for the service, or is low enough not to bother circumventing, then they are more likely to use it legitimately.

Encoding raw h.264 data to browser via Dash

I have a live stream of raw h264 (no container) coming from a remote webcam. I wanna stream it live in browser using DASH. DASH requires creating mpd file (and segmentation). I found tools (such as mp4box) that accomplish that in static files, but i'm struggling to find a solution for live streams. any suggestions - preferably using node.js modules?
Threads i have checked:
mp4box - from one hand i saw this comment that states " You cannot feed MP4Box with some live content. You need to feed MP4Box -live with pre-segmented chunks." on the other hand there's a lot of people directing to this bitmovin tutorial which does implement a solution using mp4box. In the toturial they are using mp4box (which has a node.js api implementation) and x264 (which doesn't have node.js module? or is contained in ffmpeg/mp4box?)
ngnix - ngnix has a module that support streaming to DASH using rtmp. for exemple in this toturial. I prefer not to go this path - as mention i'm trying to do it all in node.js.
Although i read couple of posts with similar problem, I couldn't find a suitable solution. Help would be much appreciated!
The typical architecture is to send your live stream to a streaming server which will then do the heavy lifting to make the stream available to other devices, using streaming protocols such as HLS and DASH.
So the client devices connect to the server rather than to your browser.
This allows the video to be encoded and packaged to reach as many devices as possible with the server doing any transcoding necessary and potentially also creating different bit rate versions of your stream to allow for different network conditions, if you want to provide this level of service.
The typical structure is encoded stream (e.g. h.264 video), packaged into a container (e.g. mp4 fragmented) and delivered via a streaming protocol such as HLS or DASH.

Simperium and binary (image / video) asset files from JS

Simperium looks like an awesome way to sync data across a variety of platforms and to deal with on/offline access from mobile.
For a project I'm working on some of the data is in the form of generated image and video files. I can't find any information about whether it is possible to sync this kind of data through Simperium (I guess I could base64 encode the images but it seems like a hack).
Or would I need to sync the URLs and then manually download these resources and somehow store them locally?
Simperium has basic support for binary files on the iOS side, currently in testing. This isn't yet available in the JavaScript library, but it will be. The way it works is similar to what you described. Simperium can handle the syncing of both a URL and its associated binary content in cases where that makes sense.
On iOS, binary files are stored to the local file system (though small files can indeed be stored as base64 encoded strings if you prefer).
In JavaScript, if you're working on the client side, the situation is less clear given the storage limits imposed by browsers, but you always have the option of syncing and using standard links depending on what you're trying to do. On the server side, there are of course more options. If you have some uses cases to share, you should get in touch.

Possible to stream live video without using RTSP?

Is it possible to live stream video (& audio) without using the RTSP protocol? Today I tried out Adobe's Flash Media Server and the free alternative Red5. Both seemed like a bit of an overkill (plus had issues with Red5 not supporting AAC audio).
Basically I'm looking for a way to upload live video to my server so it can be viewed using jwplayer, and then stored so it can be viewed later. Does MP4 support live streaming? So that I can record it client-side then upload it for viewing?
I've been experimenting with uploading jpg images and using a HTML5 canvas to display them so it appears like a video.
Here's my code: (using only a few images)
http://jsfiddle.net/QM5EV/
There's several things wrong with it. For one, it's not efficient because it requires mass amounts of jpg's to be uploaded. And most importantly there's no audio.
What would be best to do? Is RTSP the only sensible choice? Thanks. :)
Live via HTTP servers is, for the most part, not an option. But there is "Apple Live Streaming" aka MPEG-TS, although that limits your clients to iOS devices. It uses a plain ol'web server. (This seems to be changing, increasingly desktop browsers are supporting MPEG-TS, but will probably take some time before it is common place.)
For online streaming, rtsp is the best solution. Other protocols such as RTMP ( http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol) but transmit to any multimedia content using RTSP.
Another thing is that you can make a specific streaming server accepts HTTP redirect requests. Thus, instead of URL's as rtsp://mydomain.com:554/myfile.mp4 can have URL's like http://mydomain.com/myfile.mp4
Regards!

Categories

Resources