Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Native VFP Encryption Code
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01294514
Message ID:
01294732
Vues:
22
>Anyone have a native VFP encryption/decryption class I can have?

This crude, but it gets the job done.
*-- Encrypt
lcStr = Crypt("Hello world", .t.)
*-- Decrypt
? Crypt(lcStr)

PROCEDURE Crypt
	LPARAMETERS tcStr, tlEncrypt
	LOCAL lcAlpha AS STRING, lcKey AS STRING, lcStr AS STRING

	lcAlpha = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_]
	lcKey	= [HzABV782NECbKLUM3ISTFxP96tuXiDfyeYghjkawpZ-01oqJnGOscvl45_m.WdQRr]
	IF tlEncrypt
		lcStr = CHRTRAN(tcStr, lcAlpha, lcKey )
	ELSE
		lcStr = CHRTRAN(tcStr, lcKey, lcAlpha )
	ENDIF
	RETURN lcStr
ENDPROC
Greg Reichert
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform