How to protect my video files from copy on CD

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 3261 Views - Last Post: 30 March 2011 - 11:02 PM Rate Topic: -----

#1 rahmanian  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 21-February 11

How to protect my video files from copy on CD

Posted 30 March 2011 - 06:08 AM

Hello friends
I 'm working on a project that is a series of training videos
its a program that catogories kessons and when users clicks on the lesson subjects it playes related video
all of this works are easy but i want to write this videos on cd and i want to protect videos and cd application by licensing
and I should protect my videos from being copy !
how can i first encrypt my videos on a file and then play them in my program , in this way i think no one then can copy my video files, any idea ?
how can i do this works ?
thank you all.

This post has been edited by rahmanian: 30 March 2011 - 06:18 AM


Is This A Good Question/Topic? 0
  • +

Replies To: How to protect my video files from copy on CD

#2 CodeGrappler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 120
  • Joined: 29-November 10

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 06:44 AM

I would pack all of the video files into 1 file sort of like a zip file but with your own file format and possibly an encryption of some kind. It will deter your average user from copying them for sure.

In order to do that you would create an index with all the filenames, sizes, offsets. Write this index either to the beginning or end of the file. If you choose the end you will need to write the offset of the index to the beginning of the file so you know where to find it. Then you just write all the video file data to the file. Apply encryption of your choosing and done.

However there is still a problem. Your program knows how to read it and show the videos. So you would need to create a decent licensing scheme. Perhaps have the program ask for a cd-key of sorts on first time run. After the user supplies the key it stores it in a database on your server along with a hardware guid. So the same key can not be used on multiple computers.

Just a thought.


Example "zip" file format
UInt64 indexOffset;
Byte[] fileData;
Int32 fileCount;
FOR EACH fileCount
    string fileName;
    UInt64 fileLength;
    UInt64 fileOffset;
END


This post has been edited by CodeGrappler: 30 March 2011 - 06:49 AM

Was This Post Helpful? 1
  • +
  • -

#3 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9363
  • View blog
  • Posts: 35,172
  • Joined: 12-June 08

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 07:13 AM

Okay - what's your plan of attack? Have you outlined the steps you need to start with?

There are plenty of resources for encryption/decryption and c# out there. Any strength of encryption you were thinking about?

I would think that you would need to research how to 'encrypt' a video. Various types and keys.
I would then figure you would need away to keep your decryption key hidden in your code, right?
Then decrypt your videos before you play them. That might eat up some processing time, right? Make sure to do it as quickly as possible.

I hope the videos are yours, and you are not repackaging someone else's content.

Let's tackle licensing after you work through some of this encryption of the video business.

Remember - DIC is to help you here and there, but we love to see a developer stand up on his own and do the leg work, the research, and succeed! Handouts don't help you become a better programmer!
Was This Post Helpful? 1
  • +
  • -

#4 rahmanian  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 21-February 11

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 09:12 AM

Thank you dear modi and CodeGrapler
I 'll do what you said, which one is better ? keeping video files in a packed file and then decrypt them ? or encrypt each one and the decrypt ?
all of videos are mine and me and my coworker are recording them in the studio with blue screen techniqs and its important for us to protect our film from being copy.
thank you again.
Was This Post Helpful? 0
  • +
  • -

#5 CodeGrappler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 120
  • Joined: 29-November 10

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 09:44 AM

Put them all in the "zip" and then encrypt. Encrypting each one separately isn't necessary. Then you decrypt the archive before reading from it.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9363
  • View blog
  • Posts: 35,172
  • Joined: 12-June 08

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 09:53 AM

Sure there's that, but what about the memory management. If we have an encrypted zip file of 700+mb of video that's going to take a toll on the system. Decrypt to memory, extract one file to memory, play the file.
Was This Post Helpful? 0
  • +
  • -

#7 rahmanian  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 21-February 11

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 10:30 AM

Yes , Modi is right , i've to unpack needed files to memory and then play the stream , i think its the right way , dosent it ?
Was This Post Helpful? 0
  • +
  • -

#8 CodeGrappler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 120
  • Joined: 29-November 10

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 10:52 AM

Well yeah. No where in there did I say store an entire archive in memory.
Was This Post Helpful? 1
  • +
  • -

#9 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9363
  • View blog
  • Posts: 35,172
  • Joined: 12-June 08

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 11:11 AM

That more or less is implied. Unless I am missing something in the "custom" suggestion - you need to have the archive in a stream of some sort to decrypt it, right? From there you need to be able to expand the decrypted archive to be able to extract the file, right? Sure I guess you can do each of these and save them to the local drive, but that leaves your videos out in the open so in memory's the only thing I am thinking would take care of the security as you are attempting to pick a file out.
Was This Post Helpful? 0
  • +
  • -

#10 CodeGrappler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 120
  • Joined: 29-November 10

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 11:36 AM

View Postmodi123_1, on 30 March 2011 - 11:11 AM, said:

From there you need to be able to expand the decrypted archive to be able to extract the file, right?


Compression is not encryption.

When you open a 8gig zip file does winzip or winrar take up 8gig of memory? No they do not.

You only put in memory what needs to be in memory.

You only read what needs to be read from the archive.
Was This Post Helpful? 0
  • +
  • -

#11 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9363
  • View blog
  • Posts: 35,172
  • Joined: 12-June 08

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 11:42 AM

Yeah am aware encryption is not compression (or vise versa). Both make the original file unreadable until their appropriate actions are taken (decrypt/decompress). Winzip is able to decompress to the hard drive, right? Then you can open up the folder of videos. If OP is looking to keep people's grubby hands away from his videos does it make sense to have them all out in the open when his program is running? I think not. So the temp file of being able to write to the local drive is out, correct?
Was This Post Helpful? 0
  • +
  • -

#12 CodeGrappler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 120
  • Joined: 29-November 10

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 11:52 AM

Do not write them to the hard drive. Read the section that needs to be decrypted into memory. Decrypt and play. No you will not be able to use any old encryption algo with this. But the fact remains there is no need to read the whole thing into memory.
Was This Post Helpful? 0
  • +
  • -

#13 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9363
  • View blog
  • Posts: 35,172
  • Joined: 12-June 08

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 11:58 AM

Maybe I am just having issues today, so explain it to me like a third grader. If an archive is a file structure that houses other files and also compresses it. To access a file in it (or even know a file IS in it) you have to decompress the structure and peek inside. It's not like windows 7 where unzipping is part of the Explorer and the file system sort of makes it look like they treat zips like any old folder.

Then if you throw the extra complexity of encrypting the archive you need to get that decrypted so you can fiddle with the compressed bits properly to open up something that maybe a structure holding other files.

You can't just carve up a zip file and say "rehydrate these bits only please!"; it has to be the whole thing.
Was This Post Helpful? 0
  • +
  • -

#14 CodeGrappler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 120
  • Joined: 29-November 10

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 12:06 PM

I never implied or specifically said the "archive" should be compressed. Stop assuming that it is, for it isn't. I think if you stop thinking about it as a compressed archive you may understand.

I will post a code sample that will hopefully help you understand.

This post has been edited by CodeGrappler: 30 March 2011 - 12:06 PM

Was This Post Helpful? 0
  • +
  • -

#15 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9363
  • View blog
  • Posts: 35,172
  • Joined: 12-June 08

Re: How to protect my video files from copy on CD

Posted 30 March 2011 - 12:18 PM

The use of "zip", "archive", "winrar", and "winzip" all lead to the implied compression.

Rock on anyways...
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2