Enabling/Disabling TypeConverter for data encryption

Posts   
 
    
greenstone
User
Posts: 132
Joined: 20-Jun-2007
# Posted on: 08-Jun-2012 21:20:55   

LLBLGen 3.1 Final: September 30th, 2011

We have written a type converter to encrypt/decrypt some data going to/from the database for particular database fields. It seems to work well!

We have some customers (running our app) who want their data encrypted, and some who don't want it encrypted.

Can we either: 1.) Have the application disable the type converter for a field run-time (so someone with a system with encryption = 'off' will not have the encrpt/decrypt done)?

-or- 2.) Have the type converter query a field in the database record to tell if it's encrypted (and skip decryption if the database column is not encrypted)?

Thanks!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Jun-2012 00:25:38   

I rather would go for (1) because you could simply put that flag in your *.config. As the Type conversion occurs in-memory you better do this in memory. Depending on DB side could complicate things IMHO. But you can use (2) to retrieve the setting in your Application_Start to save it in a configuration file, or something like that. However as this is something that varies from implementation to implementation, you could just go for (1).

David Elizondo | LLBLGen Support Team
greenstone
User
Posts: 132
Joined: 20-Jun-2007
# Posted on: 09-Jun-2012 03:16:15   

Thanks for the reply.

So with going with the web.config option (option 1)...

Is there a way to disable a type converter from being called in the web.config? Or do you mean a web.config setting a System.Configuration.AppSettings key and reading that key from the type converter?

Thanks!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 10-Jun-2012 23:15:58   

greenstone wrote:

So with going with the web.config option (option 1)...

Is there a way to disable a type converter from being called in the web.config? Or do you mean a web.config setting a System.Configuration.AppSettings key and reading that key from the type converter?

I mean a custom setting in AppSettings that your TypeConverter can read. There is no easy way to disable the TypeConverter as it's part of the persistence info of your field.

David Elizondo | LLBLGen Support Team