Solved

Encrypt/corrupt/something video files

Posted on 2013-01-10
6
452 Views
Last Modified: 2013-01-17
hi guys,

i have a bunch of short .wmv video clips that i've made using camtasia and i'm building a simple vb6 app that will act as the media player to play said clips (using the microsoft media component in vb). my problem is that i dont want anyone to play these video clips using anything besides my vb6 media player app, what are my possible solutions?

off the top of my head i was thinking to encrypt the video clips and then when someone tries to load said clips in my player to copy them to a temp folder, decrypt, play, delete when finished. obviously theres a lot of dead time here in copying and decrypting, as well as obviously the cleanup and 'security' of it. unfortunately i dont know anything about media files and their structure, im guessing encrypting the entire file isnt required as long as one could encrypt/corrupt the file header thus removing the ability for other media players to interpret what codec's are used and whatnot, however i'm sure there are far better solutions out there. what can anyone think of?

thanks
0
Comment
Question by:gem56
  • 2
  • 2
  • 2
6 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 38767774
If you want a simple solution, just change the file extension to .gem56 or something instead of .wmv. Your average user will not change file extensions at random to try to get them to load.

The more secure way would be to write your own codec that decrypts as it plays and save it in that format, but I'm guessing you don't want to take that much time.
0
 
LVL 9

Expert Comment

by:shorvath
ID: 38768192
I've done this before and it's real easy..  Just add all your clips to a VB Resource File.
working example
Then you can write them out a required and delete them when your done..

Dim iFile As Integer
Dim byteArr() As Byte

If fso.FileExists(App.Path & "\LItoWO.avi") = False Then
   byteArr = LoadResData("LITOWO", "VIDEO")
   iFile = FreeFile
   Open App.Path & "\LItoWO.avi" For Binary Access Write As iFile
       Put #iFile, , byteArr
   Close iFile
End If
DoEvents

Open in new window

0
 

Author Comment

by:gem56
ID: 38772995
hi guys,

thanks for both of your replies.

@TommySzalapski: writing my own codec may be just a little overkill as i wouldn't even know where to begin and i cant imagine it to be any small task. Renaming the extension would be a good first step, i expect depending on how ambiguous the filename is would also dictate how likely a user is to drop the file into a media player. thanks for the suggestion :)

@shorvath: thats a very interesting and smart approach. due to other limitations i'll have to think about how exactly i could put that to good use, but definitely a great place to start.

thanks for your help guys, appreciate it. i'm going to leave the question open for a couple of days just in case anyone makes any further suggestions, at which time i'll just split the points.

cheers
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 37

Assisted Solution

by:TommySzalapski
TommySzalapski earned 250 total points
ID: 38774639
If you save the file as a .dat or something, no one will think to try to open it in any media player (plus no media player will open it).
Also if you add one byte (character) to the beginning of the file, it will "corrupt the header" and cause any media player that tries to open it to fail.
0
 
LVL 9

Accepted Solution

by:
shorvath earned 250 total points
ID: 38774761
gem56

Sample App with WMV file....   (Good laugh..  Cheers)

Option Explicit

Dim FSO As New FileSystemObject

Private Sub Form_Load()

MMControl1.Notify = False
MMControl1.Wait = True
MMControl1.Shareable = False

End Sub


Private Sub cmdBeer_Click()

Dim iFile As Integer
Dim byteArr() As Byte

If FSO.FileExists(App.Path & "\Beer.wmv") = False Then
   byteArr = LoadResData("BEER", "CUSTOM")
   iFile = FreeFile
   Open App.Path & "\Beer.WMV" For Binary Access Write As iFile
       Put #iFile, , byteArr
   Close iFile
End If
DoEvents

MMControl1.FileName = App.Path & "\Beer.wmv"
MMControl1.hWndDisplay = Picture1.hWnd
MMControl1.Command = "Open"
MMControl1.Command = "Play"

End Sub

Private Sub Form_Unload(Cancel As Integer)

MMControl1.Command = "Close"
FSO.DeleteFile App.Path & "\Beer.wmv", True

End Sub

Open in new window

Project1.vbp
Form1.frm
Movies.RES
0
 

Author Comment

by:gem56
ID: 38790161
hey guys,

thanks for the help, really solid effort on both parts.

cheers
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now