Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Encrypt/corrupt/something video files

Posted on 2013-01-10
6
Medium Priority
?
470 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Assisted Solution

by:TommySzalapski
TommySzalapski earned 1000 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 1000 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn different types of Android Layout and some basics of an Android App.
Progress
Starting up a Project
Suggested Courses

705 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