Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ideas for decrypting/encrypting numeric data
Message
From
16/10/2018 17:44:26
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Ideas for decrypting/encrypting numeric data
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01662625
Message ID:
01662625
Views:
64
Hi all,

Have been encrypting some fields from some sensitive tables in an app. The app uses local views and the ones that have encrypted fields are created programmatically. The fields that are character fields are easy - extend the field to handle the increased size of the encrypted data and then decrypt on the fly and encrypt during the save process of the form.

I have written a wrapper function to make decryption really easy to incorporate into SQL strings e.g.

CREATE SQL VIEW v_Lawyers AS ;
SELECT Lastname, Firstname, ;
DecryptString(DirectLine) AS DirectLine...FROM Lawyers...

So for the character fields, the field gets decrypted in the above view, bound to the form control and then just before tableupdating the view, the pertinent fields are encrypted.

BUT, this does not work well for non-character data. For example, for birth dates I have to pull out the data using a function that converts the character encrypted date into a date field:

CREATE SQL VIEW v_Plaintiffs AS ;
SELECT Lastname, Firstname, Gender, ;
MakeDecryptedDate(Birthdate) AS Birthdate2, Birthdate FROM Plaintiffs...

So in this case, I bind to "Birthdate2" as it is in date format and carry along Birthdate which is the original unencrypted character type data. The user updates Birthdate2 and then in my save routine, I encrypt the data in Birthdate2 and overwrite Birthdate and post.

Okay, so having said all that - are there any other ways someone can think of that would make this easier? I am at the point in the project where I have to start encrypting a whole bunch of numeric type data and I will have to go through the same gymnastics on each of those fields.

BTW, this would have been transparent in the latest SQL server (I hear) where the back-end engine handles all the encrypting/decrypting - but that is not even a possibility at this point for this client.

Thanks,
Albert
Next
Reply
Map
View

Click here to load this message in the networking platform