Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

encrypted data in a table

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, sorry to bother you guys,

Is it possible to put some encrypt data into the fields of a table.
I am trying to set up a access rights table for various user to
run certain parts of an application. Further is there a way to
hide the table from being listed or shown.

Thanks
 
Hi
Click on the link for an FAQ by me on this....
How to build a Password control for you application?
faq184-1262

:) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
As Ramani says in his FAQ this is just a simple method to hide passwords. Unfortunately this also means it's simple to crack if anyone wants to. Since SYS(2007) is just an integer, an average of every 64k random passwords will give the same value. Here's a simple program I cobbled together to create fake passwords.

Code:
LPARAMETERS MyPassword
LOCAL NewPW
FindNum = ALLTRIM(SYS(2007, MyPassword))
StartNum = 1000000
n = 1
NewPW = ALLTRIM("N" + ALLTRIM(STR(StartNum + n)))
DO WHILE ! ALLTRIM(SYS(2007,NewPW)) = FindNum 
n = n + 1
IF n > 1000000
	EXIT
ENDIF
NewPW = ALLTRIM("N" + ALLTRIM(STR(StartNum + n)))
CurrNum = ALLTRIM(SYS(2007, NewPW))
ENDDO
? FindNum, CurrNum, n, NewPW

It seems to work except that for some reason I'm not sure of sometimes it will create a password which yields a longer checksum like 49079 instead of 4907 and it works.
Perhaps it needs to compare LEN(password) as well.

The only point is that if you want a table of passwords which won't just hide actual passwords from casual viewers, but not allow easy hacking, you'll need something more complex

Dave Dardinger
 
If you want to just hide passwords, I wrote an interface to the MD5, SHA-1 and ripemd-160 one-way hash functions as Windows DLLs:
and how to use use them:

But this won't work to encrypt and decrypt data. As others have said, to encrypt the actual data is more complicated than just hiding passwords. You would have to use something like DES or 3-DES, and it's safer to use a package already developped for that (I don't know if that exists for foxpro though).
 
Custer,
Indeed there are at least two 'commercial' solutions for file encryption, and other code around to 'roll your own'.

One of the easiest and most secure is Cryptor IV by Xitech ( ), but you do have to buy it. They have a demo version to show how easy it is to implement, and in my testing, there was very little overhead introduced on all but the largest tables. I've used different versions in custom apps under both FPW and VFP.

NetLib also has Encryptionizer ( but I've never used it - but others swear by it.

One freeware solution is the CryptPak by Milan Kosina ( Another is CIPHER50.FLL based on work by Tom Rettig and available at the UT ( in the Download area.

The new VFP 7.0 has a Crypto API component in the Foundation Classes (I believe it uses the MS encryption API), and using the new Database Events can make the timing for encryption/decryption easy - however it isn't really "built-in".

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top