Solved

Encrypt/corrupt/something video files

Posted on 2013-01-10
6
457 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
advertisement module in core php 4 159
iframe detection of parent window scale 20 71
Change the background and font colors in Notepad++ 5 78
SQL Insert parts by customer 12 31
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

813 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

16 Experts available now in Live!

Get 1:1 Help Now