Oh and be sure to keep in mind that .NET assemblies can be decompiled using reflector. That being said you need to hide what you are doing with the encryption:
* Put the initialization vector and keys in two different classes, located in two different files.
* Use
ROT-13 encryption on the stored keys. This will further obfuscate the true keys
* You could also encode the keys differently
* Make the keys longer than you need. IE if you need a 16 bit key then use a byte[] array of 1000 and take out the middle 16 bytes
* Dont reference the keys directly in code. Use reflection to access the member so you don't have a strong link between the decryption mechanism and the keys
But all of this work can still be undone if they decompile the code, right?
Yes. It can. Use a .NET Code Obfuscator when you build your releases.
But can't they still rip the video stream that is being sent to the video card for rendering?
Yes, they can. With vista and later the video can be encrypted with AES accessible only to the operating system and video card. You could use a license to sign your video file. Read here for more info:
http://www.sharewareconnection.com/d...n-solution.htm
But with all of this work I still have a plan video file located in the temporary directory. Isn't all of this work undone if they locate the file?
Yes, it is. If you can find an embedded video player that lets you control the file position and how it reads the file then you could write a bunch of trash to the file, then good video, then more trash, then more video, continue. You could then instruct the video player on what segments of the video file to read.
I hope this helps ... and proves that all of this work is hard, a pain in the ass to support code for, and can still be worked around.