Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dbc_BeforeOpenTable
Message
From
02/10/2004 14:40:15
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/10/2004 08:28:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00948101
Message ID:
00948243
Views:
16
>Cetin:
>
>Thanks for the tip. I think that there might be 2 problems with it that I can't see how to overcome:
>
>1. with an outside file, how to add additional names and passwords without actually opening the file and doing it manually, and;
>2. more importantly, in the case where i am doing this on my own computer and not simply providing an application to someone else, what's to stop someone from simply going into the stored procedures of the database (within the project manager) and figuring out from there how to decrypt the outside file? Is there a way of "locking" the stored procedures so it cannot be opened?
>
>Thanks for your help.
>
>Paul

1) You'd open it programmatically, read/modify and save. ie:
(Untested off the top of my head)
*CheckPW
* Read file into a cursor
local lcTemp
lcTemp = sys(2015)+'.tmp'
StrToFile(Decrypt(FileToStr('myPasswords.dat'),'myKey'),m.lcTemp)
create cursor myPWs (cname c(20),PW c(20))
append from (m.lcTemp) type delimited
erase (m.lcTemp)

*AddUpdatePW
*...
*Write back added/modified cursor
copy to (m.lcTemp) type delimited
StrToFile(Encrypt(FileToStr(m.lcTemp),'myKey'),'myPasswords.dat')
erase (m.lcTemp)
If you think nanoseconds the file is written to disk and erased might be a problem there are other ways that you do this only in memory.

2) Stored procedures could be 'locked' deleting source entry and keeping only ObjectCode. Actually they wouldn't be able to open DBC in normal ways (dbc_OpenData kicks in).

However keep in mind that these only keep away regular users. An average VFP user wouldn't be stopped by this. There are ways to stop average VFP user too. Level of security is related how much of it you need and probably you'd get help from OS and maybe from MSDE,SQL server which are not 100% secure (unless you prevent physical access).

PS: If you make Check/AddUpdate into a COM class would provide more headache for the hacker. Add to that you might play with table headers making it one step harder.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform