ok so summer break is here and i have at least 3 months to spare. so i want to learn how to make an open source folder lock program in DEV C++. right now i am working on theory for it. i am trying to plan ahead before i dive in. here is an idea of what i think the program should do:
- First Run: set up username and pass
create a folder to store files
lock program (compress folder) and exit window
A background program watches the specific file to see if it is being accessed
if so check to see if they are logged in else ask for username and pass
now if they are logged in allow access else cancel the opening of the file.
-thats my idea, please comment on how it sounds or if there is anything you would like to add.
So, basically, you want to write an archiver like 7-Zip or WinRAR. Why use file monitoring when you can just have the shell call the program when the user tries to open the file?
EDIT: As the sun god above me noted, if you want dynamic decompression, just mess around with the shell. If you want an actual lock, then EFS. You might also be able to mess around with this from the shell.
Hint 1: Read up on winsock, if you want a separate thread.
dude... wtf?... -.-
When I was younger I did something like this so that the other members of my family couldn't see the porn videos I had on my hard drive :D I would invert the bits of the header so that the format of the file was destroyed and media player couldn't open it :P Basically what you want is an encryption/decryption program. When you encrypt a file save it with a different extension and associate this extension with your program (play with your registry or file settings). Hints 2 and 3 of Albatross may be useful.
Depending on how secure you want individual files to be, m4ster r0shi's solution might be a decent one. However, if you really need to make sure nobody gets their paws on them, then you might want to consider something else.
It's a part of Windows that accepts requests by programs (e.g. Explorer or cmd.exe) to run files. It also keeps a list of associated programs. If the file extension has a program associated to it, it runs it with the following command line: program.exe "X:\absolute path to\file.ext"
Any program that understands that can be used by the shell for a file association.
ok so what i need to do is make a custom file extension and link it to a script.
when the user puts a file in the folder and "locks" it then change all file types to that new extention?
then possibly use encrpytpion later on...
but then i would have to find a way to keep track for all original 'filename.ext' in order to allow them to be opened again.
sorry if i am going in circles, just trying to get this right :D
maybe just a .txt file or .dat and only encrypt that file
do folders have extensions that can be linked to the script and in the script check which folder is being opened. if the folder being opened is the same as the locked folder then run the rest of the script otherwise exit and let the folder to its thing like usual
ok hahaha ummm... so i have one last snag i think...
so, i can get the custom extensions linked to my program but i want the program to run when to folder is accessed to avoid anyone just using "Open With..."