>CLEAR >CREATE CURSOR crsTest (Name C(200) NOCPTRANS, nAME2 C(200) nocptrans) >oCrypto = Newobject("_cryptapi", HOME()+[FFC\_crypt.vcx]) >#DEFINE NOCSP_Lines_of_code "The required Crypto Service Provider is not installed or not functioning properly on this system. Some or all of these samples may not work." > >IF !OCrypto.GetIsInstalled() > MESSAGEBOX(NOCSP_Lines_of_code) > RETURN .F. >ENDIF > >LOCAL lcEncryptedStream,lcPassword,lcKey >lcEncryptedStream = '' >lcDecryptedStream = '' > >lcPassWord = "Christine" >lcKey = "Secret Password" >IF ocrypto.EncryptSessionStreamString(lcPassWord, lcKey, @lcEncryptedStream) > >ELSE > IF ocrypto._cryptapi.GetDoubleEncryptError() > MESSAGEBOX("Sorry, you cannot double-encrypt this text.") > ELSE > MESSAGEBOX("Error: "+MESSAGE()) > ENDIF > RETURN >ENDIF > >?lcEncryptedStream >APPEND BLANK >REPLACE name WITH STRCONV(lcEncryptedStream,15), nAME2 WITH lcPassWord >lcfield=STRCONV(ALLTRIM(name),16) >mresult=ocrypto.DecryptSessionStreamString(lcfield, lcKey, @lcDecryptedStream) >?lcDecryptedStream >brow >>