views:

148

answers:

3

Hi

I am trying to create a video player in Adobe AIR. I want to encrypt the video files so that they are not sharable outside the player. I don't want to jump through hoops to create a rock-solid system but something simple that just prevents 90-95% of the users from sharing the content.

I have been through a related question on SO at http://stackoverflow.com/questions/998535/file-protection-in-adobe-air-flex

However since the Video file size would definitely exceed 10 MB, the above does not seem to be the solution.

There are a number of solutions to encrypt text strings but I have not found any that encrypt files. Any help or pointers will be appreciated.

Many thanks.

Update: We are trying to achieve this in the following manner:

  1. encrypt/jumble the first 50 binary characters of the video file and store on the hard drive. this makes the file unplayable.
  2. on runtime decrypt the first 50 characters to get the original file and copy it in a temp folder on the hard drive.
  3. on exit, delete the decrypted file and empty the temp folder.

this solves most of our problems. It does not allow sharing by simple copy and paste. Is a simple solution, though maybe not very elegant.

The problem we are facing now is that the temporary folder is not getting emptied. The file lands up in the recycle bin and can be easily recovered from there!

A: 

Can you authenticate the files when the files are downloaded in PHP or some other scripting language? You could force the SWFs to require a parameter to be passed in via post or something (untested however), which most other players wouldn't do .....

You could then reduce the server load on the server pushing the file using the http header X-sendfile or a similar equivalent ...

Daniel Hai
No unfortunately we can't. The idea is to allow the video publisher to allow people to download their files but not share them. So the files need to be encrypted on the hard drive of the user.
Vinayak
+1  A: 

What you're describing is 'Digital Rights Management', and AIR does support this kind of thing, which you can read more about here:

http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118676a5be7-8000.html

DRM is a thorny issue these days, so it might be worth considering whether you really need DRM or whether you can do without it.

Qz
You are right. And I agree that DRM is more of a problem than a solution. What we want to do is not to make it impossible for people to hack or crack, but rather make it difficult to share with a simple copy and paste from the file store on the hard drive. I am adding some more info on this as an edit in my question above because it will be relevant to all readers. Thanks for your answer though.
Vinayak
A: 

What you could do is:

(1) read the first 1000 bytes of the file (2) store those 1000 bytes in an encrypted sqlite database, or the EncryptedLocalStore (3) write 1000 empty bytes to the beginning of the file.

By now, the file will not open if you double click it. Although most of the data is still there, most people will have given up.

When you need the file:

(4) retrieve the stored 1000 bytes and (5) write them back to the beginning of the file.

When finished, repeat steps 1-3.

dlmh