Protecting Videos in PHP

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
RaoYasir
Forum Newbie
Posts: 2
Joined: Sun Mar 28, 2010 11:34 pm

Protecting Videos in PHP

Post by RaoYasir »

Hi!
We are going to develop a portal in PHP which will provide the different contents for view only (all contents are paid and could only be viewed). Our contents may include pdf, txt, video or audiofiles.

Could it is possible that user can only view the videos but not be able to download them (even using any software).
If its possible then please provide me the suggestion on how to do it. and if its not possible then please explain it why it cant be done.

Thanks in Advance.

Regards,
Muhammad Yasir
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: Protecting Videos in PHP

Post by kaisellgren »

There is no bulletproof way to do that. If the user can view the video, it means that the browser transfers the bits, thus, with knowledge it can always be "downloaded". Your only option is to make it as hard as possible to get those videos so that most of your users will not waste their time and rather pay for it.
André D
Forum Commoner
Posts: 55
Joined: Thu Aug 28, 2008 7:03 pm

Re: Protecting Videos in PHP

Post by André D »

Kai is right, but there are steps you can take to make it harder for people to save your video content. Depending on how you display it, there are generally two ways deliver a video: progressive download and streaming media.

Progressive download works just like any other file download. Just like a .jpeg, for example, the file is downloaded and stored in the browser cache (which depending on the browser, may be written to the native file system). When video is served over a streaming media protocol, most players store the data in an in-memory buffer; the bits are never written to disk, and the entire video stream is usually never in memory all at once.

If you're embedding the videos with Flash, you could use Wowza Media Server or Adobe Flash Media Server. Another option is an Amazon CloudFront Streaming distribution in conjunction with their "private content" feature, which is based on Adobe Flash Media Server.
Bind
Forum Contributor
Posts: 102
Joined: Wed Feb 03, 2010 1:22 am

Re: Protecting Videos in PHP

Post by Bind »

without digital rights management of some kind, anyone can snag and reconstruct the stream with various free and commercial http data/stream-copy utilites.

the best I have found is using the microsoft silverlight player in combination with their media server and digital rights management.

unfortunately this is not a free solution.

netflix uses this mechanism very successfully to protect and display their view-it-now streaming video content.
Post Reply