Solved

Protecting  any media files and running through my program

Posted on 2004-08-06
9
146 Views
Last Modified: 2010-05-03
Can i protect any media file with extention mpeg,avi,wav so that it couldn't open in any player. And then can i write a program so that i can pass a password to that protected media file and it runs in the player which i have created in that program.
0
Comment
Question by:itmastero
  • 3
  • 3
9 Comments
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11742263
You can write a program to encrypt/protect the file using password, but in then you have to change the file extension, otherwise your program wont run if you run that media file (well except if you set your program as a default program for all media files)

Darko
0
 

Author Comment

by:itmastero
ID: 11756429
How do i do that with a media file which is having changed extension. can you give me the code.
0
 
LVL 22

Accepted Solution

by:
DarkoLord earned 110 total points
ID: 11761351
Well I can give you some steps/directions:

First make file encryption/decryption... you can find an example here:
http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=54321&lngWId=1

Then make a function that will open the file and ask you for password... when correct password is entered, the file is decrypted and copied to a temporary location with original file extension and then run...

Then you can register your own file extension and make that all files with that extension will open in your program... example here:
http://www.vbforums.com/showthread.php?s=&threadid=270865&highlight=file+extension+register

Darko
0
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.

 

Author Comment

by:itmastero
ID: 11871728
Darko the links you gave were good enough to encrypt small size media files but if i have a whole big movie of 3 hrs. then that takes a long time to encrypt and decrypt it so thats like a person should have grt patient to wait for that. can u suggest me some faster way to do that.
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11874601
Well other way would be to just add some encrypted strings at the end of the file... that way the original media file becomes inaccessible... so when user enters the password, you try to decrypt the string at the end of the file and if successful, you copy the file without that crap at the end to another location and then play it

One thing though, you still have to copy the file to another location after "decrypting" (if you dont do that, the user could just crash your program and the decrypted file would still remain there)...
0
 

Author Comment

by:itmastero
ID: 12468863
Really speaking i have no received any better solution. So this can be disposed off. Thank you.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

816 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

7 Experts available now in Live!

Get 1:1 Help Now