Right now I am thinking for a way to create a secure video streaming server with the following assumption:
- people can be trusted not to distribute the video they have rights to see.
(I think in the first edit of my question I was not able to articulate my thoughts. The thing that people are trusted is not a requirement, but an assumption. And I think that in some cases it is valid. For example: you do not trust people with your credential card and do not want them to know your secret, but you might trust your wife with it). The same way there might be a group of people inside one organization that would like to have some shared videos and they trust each other (they might be wrong, but right now they trust).
- people have to login with their credentials to see videos
- different people should have rights to see different videos
- it should be able to use CDN caching (videos can be pretty big)
- video should be viewed on different platforms and devices.
The part with login credentials to see videos does not look so hard, the problem arise when you have to stream video to a user. Without somehow encrypting the video there is a potential to MITM attack (and also the chunks can be stored CDN and then freely viewed).
In the beginning I thought that this is also not a problem and the only thing that is needed is to serve the video over https. But then I realized that in such a way it is not possible to utilize CDN caching (although browser caching will still be possible).
Another approach I thought of is to create a private key for each video and to encode the video with this key. If the should have rights to view it he would receive a key to decrypt the video (thus all the users who have rights to view a particular video would have to access the same encrypted video and therefore it can be cached on CDN with no risk). The problem here is that decryption should be performed on the client and the way I can see it is through flash (which not every device support).
I assume that players like google and netflix has already done something like this but was not able to find how they have achieved it. So is it possible to build the system that satisfies the above mentioned criteria and if so - what is the approach?