Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASCII wierdness with encryption/decryption routine
Message
De
05/09/2002 14:21:19
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00697072
Message ID:
00697188
Vues:
15
>I'm converting a program originally written in Foxpro 2.5 for DOS into Visual Foxpro 6.0. One maddening idiosyncrosy I've encountered is the following:
>
>There are an encryption and decryption routines used for storing user passwords to a database. These routines work just fine in the DOS version. However when I use the IDENTICAL code in Visual Foxpro, I get erratic results. Occasionally, the encrypted password will decrypt just fine. But most of the time, at least one of the characters in the password will decrypt incorrectly. I have pulled these functions out of the program and run them independently of the larger program just to be sure there is nothing in the program which might be distorting this process.
>
>The encryption/decryption routine operate by the relatively common method of manipulating ASCII values via an algorythm. In DOS, everything works great, in Windows/Visual Foxpro, most of the time it doesn't. I have been unable to discern whether it is the encryption or decryption which is malfunctioning.
>
>Does Visual Foxpro/Windows handle ASCII values differently that DOS? If so, is there a Foxpro function which creates a compatibility between Windows and Foxpro ASCII handling?
>
>Confidentiality issues prevent me from posting the source code of these routines publicly, so I hope there is a generic answer which will rectify this idiosyncrosy.

Along with what Cetin said, you may need to mark the field where you store the encrypted value as binary (character or memo) if you're using Modify Structure, or as NOCPTRANS if you're creating the table in code. That way the values in those fields won't be interpreted through the table's codepage, but rather taken literally.

Another thing that may influence string comparison and manipulation is Set("Collate"). Make sure you set collate to machine on entry in your encryption/decryption code, and restore it on exit. Any other collate sequence can influence string comparison.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform