• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3993
  • Last Modified:

encrypting a sql server field to be used with entity framework

Hi,

I have some fields in my sql server 2008 database that I would like to be able to encrypt.

I will then be accessing these fields with entity framework and c#.

How can I do this?

The types of fields I will be wanting to encrypt are things like address etc so they cannot be viewed from within the db?

Thanks in advance.
0
scm0sml
Asked:
scm0sml
  • 3
1 Solution
 
DhaestCommented:
Security Considerations (Entity Framework)
http://msdn.microsoft.com/en-us/library/cc716760.aspx
0
 
DhaestCommented:
You can use AES Encryption (2 way encryption). When you need to query the db you can send the encrypted string that can represent the target value.

You can create an Extension to Decrypt the Entity.

MyTableEntitiesSet.Where(c=>c.MyField == MySeekValue.Encrypt()).First().Decrypt(); This can do a database query.

Be aware of data size, encrypted data is larger...

Source: http://stackoverflow.com/questions/3299054/encrypted-columns-with-entity-framework
0
 
DhaestCommented:
Entity Framework And Encrypted Fields
http://codingheadache.com/?p=4
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now