I need to encrypt some fields on my Linq2Sql Entity. I would also like the process of encryption and decryption be transparent to the consumer of the entity, meaning that once the entity is loaded into memory the field is presented as regular value string (decrypted), but the same fields gets encrypted when being persisted to the database.
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- “Zero out” sensitive String data in Swift
- Bulk update SQL Server C#
There is another option: you could "hide" the actual property with e.g.
protected
access modifier and the add a "fake"public
property to the entity partial class which will encrypt/decript thisinternal
in getter/setter, so it will be transparent to the consumer:.dbml file:
and then in a partial class:
well , SQL 2008 can encrypt a colunm of a table, and the app doesnt have to handle that. heres the link. mind you this has a performance price on the sql server`s CPU.