>Hi,
>
>Client has asked that key fields in their tables be encrypted (native VFP tables). This is fairly easy to do via wwEncryption from WestWind - at least for text data.
>
>For numeric data, the data has to be converted to a string, then encrypted and then stored as a string (same goes for date data).
>
>Question: instead of encrypting the numeric data, is there any other field type that I could convert the data to such that it would obfuscate it (render it less meaningful for the casual hacker) and to save a round trip through converting to string, encrypting and back again?
>
>I thought of storing a log value to the table but I think the amount of decimals stored is going to throw off the conversions.
>
>Anyhow, just thought I would ask in case someone who does more "mathy" stuff knows if VFP has some capability I am not aware of.
>
>Thanks,
Short answer is no (I assume "casual hacker" is not a beginner).
It also depends on the meaning of "numeric". For example, if the hacker is amateur enough, and the numeric is a double, then you could use it as datetime (what a datetime is behind the scenes). You could do bit shifting and rotating, bintoc, ctobin with a char field etc. However all of these would have back and forth overhead, converting to string and encrypting might just be the way to go. Probably, it would be easier to transfer the data to another backend and use it.
PS: Conversion + encryption overhead is generally negligible (of course it may not if what you often do is to insert lots of new data). Indexed searches on such a column would also be tricky. And you should keep in mind that string operations in VFP is very slow.
PS: And it is questionable why the key fields be encrypted.