Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Encrypting password column in a table?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00933970
Message ID:
00935132
Views:
22
>I have a DBF that contains a user userid and password. I would like to encrypt the password column and be able to still use its value as normal. What is the best most straightforward way to do this without purchasing a third party product?

_Crypt is in your fll directory:
FUNCTION  EncryptPasswd()

LPARAMETERS StringToDecrypt

#IF .F. 
	LOCAL Request as wwRequest, Response as wwResponse
#ENDIF

LOCAL lcDecryptedString
lcTryToGuessMe	= "MySecretWord"
IF VARTYPE(oCrypto) != "O"
	oCrypto=NEWOBJECT("_CryptAPI",HOME(1)+"FFC\_crypt.vcx")
ENDIF

* Decrypt secure number
oCrypto.DecryptSessionStreamString(ALLTRIM(StringToDecrypt),lcTryToGuessMe, ;
	@lcDecryptedString)

RETURN lcDecryptedString

ENDFUNC	&& EncryptPasswd
and
FUNCTION  DecryptPasswd()

LPARAMETERS StringToEncrypt

#IF .F. 
	LOCAL Request as wwRequest, Response as wwResponse
#ENDIF

* Decrypt secure number

LOCAL lcDecryptedString
lcTryToGuessMe	= "MySecretWord"

IF VARTYPE(oCrypto) != "O"
	oCrypto=NEWOBJECT("_CryptAPI",HOME(1)+"FFC\_crypt.vcx")
ENDIF
oCrypto.DecryptSessionStreamString(ALLTRIM(StringToEncrypt),lcTryToGuessMe, ;
	@lcDecryptedString)
RETURN lcDecryptedString

ENDFUNC	&& DecryptPasswd
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Previous
Reply
Map
View

Click here to load this message in the networking platform