Hi,
Using LLBLGen 4.2.
We have written an LLBLGen type converter that does application-side encrypting/decrypting of data (of an "employee" table) before it's set/get to/from the database (our application can run either on Oracle or SQL Server as the database).
We have the data get encrypted in several columns of the "employee" table. For example, the data encrypted is first-name, last-name, social-security-number, etc. We also have large binary documents (e.g. .pdfs) stored (in a child table) in the database as varchar(max)/blob fields for each employee.
The way we control if the encryption/decryption type converters actually do the encryption/decryption is for the type converter code to look for the encryption key specified in the web.config (the type converter looks a the .config and skips encrypting/decrypting if there is no key...meaning the database is not encrypted).
To convert the whole database from not-encrypted, to encrypted, we have an off-line console utility that will crawl that database employee table (and child tables) records and encrypt the employee records one by one.
This all works fine on our development machines and smaller test databases.
However, when we get to a database the size of the production database (million employees), we realize it takes several days for this utility to encrypt all records (probably mostly because of large binary data fields). The problem is that we can't take the system off-line for many days to do a complete database encrytion.
An approach we're considering is to have the web application run on both encrypted and unencrypted employees (which the utility is encrypting the employees in the background). We'd like to be able to run the web-application in this mixed encrypted/unencrypted mode (until a couple days later when all records are encrypted): The determinination of whether the type converter encryptes/decrypts based on the encryption flag in the "employee" entity/record.
Instead of the current, where the type-converter checks the .config if it should encrypt/decrypt, we'd need the type converter to convert based on the "encrypted" flag in the "employee" record.
One approach we came up with would be to possibly have the "employee" entity have both a FirstName and a FirstNameEncrypted field: FirstName would not have a type converter. FirstNameEncrypted would be mapped to use the encrytion type converter. Both entity fields would be mapped to the database FirstName field in the employee table. In the code, whenever we get/set FirstName, we'd have to access the correct entity field based on if the EmployeeEntity.EncryptionFlag.
It does mean making a number of duplicate-except-use-encryption-type-converter fields for the entity...which adds come code complexity. Maybe there's a better way the type converter itself can know if the "employee" entity has it's "is encrypted" flag set?
Any thoughts would be appreciated.
Thanks!