Results 1 to 7 of 7

Thread: Creating a program that protects other files.

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    7

    Creating a program that protects other files.

    Hi, I was wondering how I would go about making a program that password protects other files, I am pretty intermediate at vb. I am not asking how to make it but was wondering how I would possibly do so. Any help would be appreciated.

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Creating a program that protects other files.

    Well first you need to define what you mean by "password protect" and "other files". What kind of access are you trying to prevent, for what purpose, bearing in mind that there are many ways to bypass a simple password system, not least a hex editor. So if you wanted a document to be completely unreadable to to anybody but the 'right' person(s) you'd need to be thinking about encryption which is a whole other ballgame. If on the other hand you just want the files to be inaccessible altogether then you could simply zip them in a password archive (but it would be a tad annoying to have to extract and then delete them every time you wanted to access them - might be fun to come up with a self-destruct sequence though!)

    The Devil, as they say, is in the detail!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    7

    Re: Creating a program that protects other files.

    Sorry for not explaining very well, I mean password protect as in when you open a file such as a text document, it would come up with with something like a form that asks for the password. I have learned on how to encrypt text so that will not be a problem. I am not looking for something very secure as I am just learning and am probably not going to be using the program on very important files, I also have worked with various hex editors to look into programs.

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    7

    Re: Creating a program that protects other files.

    Quote Originally Posted by dunfiddlin View Post
    Well first you need to define what you mean by "password protect" and "other files". What kind of access are you trying to prevent, for what purpose, bearing in mind that there are many ways to bypass a simple password system, not least a hex editor. So if you wanted a document to be completely unreadable to to anybody but the 'right' person(s) you'd need to be thinking about encryption which is a whole other ballgame. If on the other hand you just want the files to be inaccessible altogether then you could simply zip them in a password archive (but it would be a tad annoying to have to extract and then delete them every time you wanted to access them - might be fun to come up with a self-destruct sequence though!)

    The Devil, as they say, is in the detail!
    Sorry for not explaining very well, I mean password protect as in when you open a file such as a text document, it would come up with with something like a form that asks for the password. I have learned on how to encrypt text so that will not be a problem. I am not looking for something very secure as I am just learning and am probably not going to be using the program on very important files, I also have worked with various hex editors to look into programs.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Creating a program that protects other files.

    It's not quite so simple as you might think because a data file can't just prompt the user for a password. That sort of logic must be implemented by the OS or else the file must be processed by an application or else be an application itself. For example, password protected ZIP files must be processed by the OS or some other ZIP application, e.g. WinZip, or else they must be self-extracting EXEs. Password-protected Office files are processed by the Office application and it prompts for the password. So, how do you propose the passwords be handled in your case? If you're talking about any file and not requiring your app to use it then you'd have to go the self-extracting route, which means that the output would have to be executable.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    PowerPoster Evil_Giraffe's Avatar
    Join Date
    Aug 2002
    Location
    Suffolk, UK
    Posts
    2,555

    Re: Creating a program that protects other files.

    I'm not sure I would choose .Net for this, but one approach is to write a low level function that hooks into the OS's file access routines that can determine that a given file that is trying to be accessed is encrypted, and prompt for the key and then decrypt on the fly to return the unencrypted contents. This is plenty nasty though - there's a wealth of things that can go seriously wrong when you're injecting your own routines into the OS, and you'd need to understand exactly what's going on very well in order to not break the entire system

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Creating a program that protects other files.

    Quote Originally Posted by Evil_Giraffe View Post
    I'm not sure I would choose .Net for this
    That's one of the most important points. For a start, anything written in a .NET language won't work is the .NET Framework is not installed.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width