Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Crypto Class
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01452254
Message ID:
01452480
Vues:
63
That workd for me:
CLEAR
CREATE CURSOR crsTest (Name M NOCPTRANS, nAME2 M 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."

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(name,16)
? lcfield
? lcfield == lcEncryptedStream
lcDecryptedStream = SPACE(200)
mresult=ocrypto.DecryptSessionStreamString(lcfield, lcKey, @lcDecryptedStream)
?lcDecryptedStream
brow
BTW you used EncryptSessionBlockString but DecryptSessionStreamString not DecryptSessionBlockString
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform