Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encrypting password column in a table?
Message
De
19/08/2004 13:34:32
 
 
À
19/08/2004 12:42:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00933970
Message ID:
00934581
Vues:
26
The VFP guru otherwise known as Sergey set me straight. Now I am using this approach which is much better:
* Get the cipher50.fll file from the below url:
* http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,54,33,9222

IF NOT 'CIPHER50' $ UPPER(SET('library'))
   SET LIBRARY TO cipher50.fll
ENDIF

lcText = "ABA"
lcEncryptKey = "Whateveryoulike"

? "Base Value: ", lcText
? " Encrypted: ", encrypt(lcText, lcEncryptkey)
? " UnEncrypt: ", encrypt(encrypt(lcText, lcEncryptkey), lcEncryptKey)
>Tom,
>
>I'm not aware of FoxCrypto.FLL, but the name Base64 means something to me. Isn't waht you're doing below the same as StrConv (cExpression, 13) and StrConv (cExpression, 14) ?
>
>Regards,
>
>Fernando
>
>>Here is the solution I came up with:
>>
>>
>>
>>* Get FoxCrypto.FLL at http://www.connectthenet.com/foxpro/FoxCrypto.fll
>>
>>
>>SET LIBRARY TO FoxCrypto.FLL
>>LOCAL lnHandle
>>CLEAR
>>lcBuffer = "Testing"
>>? "     Base Value: ", lcbuffer
>>
>>lnHandle = Base64encoderCREATE( .F. )
>>IF lnHandle > 0
>>    Base64encoderPUT(lnHandle, lcBuffer)
>>    Base64encoderCLOSE(lnHandle)
>>    lnSize = Base64encoderMaxRetrievable(lnHandle)
>>    lcBase64Encoded = Base64encoderGET(lnHandle, lnSize)
>>    ? "Encrypted Value: ", lcBase64encoded
>>    Base64encoderDestroy(lnHandle)
>>ENDIF
>>
>>lnHandle = Base64decoderCREATE()
>>IF lnHandle > 0
>>    Base64decoderPUT(lnHandle, lcBase64encoded)
>>    Base64decoderCLOSE(lnHandle)
>>    lnSize = Base64decoderMaxRetrievable(lnHandle)
>>    lcBase64decoded = Base64decoderGET(lnHandle, lnSize)
>>    ? "Decrypted Value: ", lcBase64decoded
>>    Base64decoderDestroy(lnHandle)
>>ENDIF
>>? "Matches = ", lcBase64decoded == lcBuffer
>>
>>
>>
>>
>>
>>>>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?
>>>
>>>Would it be possible to store hashes of those values, rather than the values themselves?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform