Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 Tags
Subject: RE: Password Protection
Thread ID: 160680 Message ID: 162141 # Views: 54 # Ratings: 0
Version: Visual FoxPro 9 Category: Security and Application Protection
Date: Friday, February 29, 2008 2:08:54 AM         
   


> > I have an aplication that uses authentication (Users and passwords). I have a complain from one of my clients that what ever passwords he made thers one guy he has a small program he uses to review and reveal any passwords entered through the keyboard.
> >
> > How can I prptect my client and prevent the revealing of the passwords ?
>
>
> Kassem,
>
> As Barbara and Borislav have told you, if you are going to store your passwords in a table or a file of some sort, you need to encrypt them. There is another option for you though. Don't use your own password, use the Windows password. The only time you need a password is when you are logging on. The purpose of the password is to verify that you are who you say you are. If you try to log on using some other user's username, you need to have that other person's password to succeed. Once the the password entry screen has gone by, there is no further use for that password.
>
> If the users log on to Windows using their own user credentials (and if they don't security is a sham anyway) then you already know that the user is indeed who he/she says he/she is. Now all you need is the username and you can get this using GETENV("USERNAME"), SYS(0) or ID().
>
> If you are working in a Windows environment, then you can make use of Windows security. The first thing to do is to make sure that only authorized users can access your application. To do this, create a usergroup called MyAppUsers (or what ever). Now go and add all of the authorized users to that user group and then go to your application's EXE file and set up the permissions. Remove the "everybody" from the permissions list, add your MyAppUsers and give them Read/Execute privledges. Add your SysAdmin and give him/her full control and do the same for yourself. Note: If you are working on a peer to peer network, you won't be able to create the user group, so you will have to give each user read/execute permission one at a time. Now, your EXE is protected. Only authorized users will be able to see your EXE, let alone be able to run it.
>
> So far, so good. The next step is to protect your data. Start by creating a new user account called "MyAppUser" (or what ever) and only you and the SysAdmin will have the password for that account. Now, go into the permissions for your Data Directory and set up the permissions such that you and the SysAdmin have full control and that new user account, MyAppUser, has Read/Write permission. Remove all other user accounts from the permission list. Next, go into your Main.Prg and have your app "impersonate" that MyAppUser. To learn how to do this, take a look at Bernard's excellent FAQ here:
>
> http://www.foxite.com/faq/default.aspx?id=48
>
> Now, only you, the SysAdmin and that new user account have access to the data. The only way for a user to get access to the data is to go through your applcation. The only way that they can get at your application is to be an authorized user. You don't need a password in your app. The benefits of doing it this way are:
>
> 1 - you don't need a password entry form. (Less work for you)
> 2 - you don't need a password table and you don't need to encrypt it. (Again, less work for you)
> 3 - your sysadmin does not want, nor does he/she need yet another utiliity for setting permissions. SysAdmins want to use Active Directory (the utility that comes with Windows Server) and using this method, he/she can. (Less work for your SysAdmin)
> 4 - your users do not need to remember two passwords - one for Windows and one for your app. (less work for them)
> 5 - Your application and your data are both protected from malicious use and inquisitive eyes.
>
> This is the way Windows applications are supposed to work.
>
> Print this off and then go invite your SysAdmin out for lunch and discuss this with him/her. See what he/she thinks.
>
> Ken
> You shall know the truth - and the truth shall set you free. (John 8:33)

Bit of an update on this.

I ran into a strange breed of SysAdmin today - the kind of sysadmin who likes to lock everything down. (Well, quite possibly not so strange a breed.) This particular sysadmin locked down his server to the point where the users could not do anything - including add a new directory. If you want a new sub-directory added to a server share, you had to go through him. In this particular application, when ever a new ProductCategory record is added, we need to add a new sub-directory in the ProductImages directory. Product images are stored within product it's own product category directory. Unfortunately, the sysadmin's strict (in my mind, paranoid) policies broke my app. Thankfully, I built my app as an Active Directory aware app, and I was able to convince this SysAdmin that while the user might not be allowed to add sub-directories, that special user account would be allowed to. On the ProductImages directory, he simpliy gave my "MyAppUser" account full control rights. The users still have no rights, but the special account does. My app now works again.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)



COMPLETE THREAD
Password Protection Posted by KASSEM NASSER @ 2/15/2008 9:00:31 PM
RE: Password Protection Posted by Borislav Borissov @ 2/15/2008 9:05:40 PM
RE: Password Protection Posted by KASSEM NASSER @ 2/15/2008 9:14:42 PM
RE: Password Protection Posted by Borislav Borissov @ 2/15/2008 9:20:16 PM
RE: Password Protection Posted by Barbara Peisch @ 2/15/2008 9:23:51 PM
RE: Password Protection Posted by Jun Tangunan @ 2/23/2008 6:13:24 AM
RE: Password Protection Posted by Ken Murphy @ 2/15/2008 10:34:22 PM
RE: Password Protection Posted by Craig Boyd @ 2/16/2008 12:29:08 PM
RE: Password Protection Posted by Ken Murphy @ 2/16/2008 1:14:05 PM
RE: Password Protection Posted by Jim Booth @ 2/17/2008 6:41:47 AM
RE: Password Protection Posted by Ken Murphy @ 2/17/2008 12:35:03 PM
RE: Password Protection Posted by KASSEM NASSER @ 2/17/2008 5:31:45 PM
RE: Password Protection Posted by Ken Murphy @ 2/17/2008 7:11:48 PM
RE: Password Protection Posted by KASSEM NASSER @ 2/22/2008 12:24:58 AM
RE: Password Protection Posted by Joseph Agarpao @ 2/18/2008 2:39:13 AM
RE: Password Protection Posted by Ken Murphy @ 2/18/2008 11:32:30 AM
RE: Password Protection Posted by suhas hegde @ 2/18/2008 9:23:30 AM
RE: Password Protection Posted by Ken Murphy @ 2/18/2008 11:35:35 AM
RE: Password Protection Posted by suhas hegde @ 2/18/2008 5:58:48 PM
RE: Password Protection Posted by Ken Murphy @ 2/18/2008 8:38:41 PM
RE: Password Protection Posted by Ken Murphy @ 2/29/2008 2:08:54 AM
RE: Password Protection Posted by Hugo Ranea @ 2/16/2008 2:22:21 AM
RE: Password Protection Posted by suhas hegde @ 2/18/2008 9:19:47 AM
RE: Password Protection Posted by KASSEM NASSER @ 2/22/2008 12:30:43 AM
RE: Password Protection Posted by Tom Saddul @ 2/29/2008 7:21:20 PM
RE: Password Protection Posted by suhas hegde @ 3/1/2008 6:17:32 AM
RE: Password Protection Posted by Catalin Banici @ 3/4/2008 10:11:07 PM
RE: Password Protection Posted by Biju Thomas @ 3/8/2008 1:55:45 PM
RE: Password Protection Posted by Ken Murphy @ 3/8/2008 2:03:30 PM
RE: Password Protection Posted by Biju Thomas @ 3/8/2008 2:24:23 PM
RE: Password Protection Posted by Ken Murphy @ 3/9/2008 1:29:39 AM
RE: Password Protection Posted by Biju Thomas @ 3/9/2008 4:43:48 AM