8

I have a column (salary) encrypted in database (MS SQL Server). I am using the entity framework to display/edit the records from the front end. Any idea how to decrypt the column in the front end to show the salary value?

Thanks

9
  • 3
    What type of encryption do you use? MD5? Some encryption types cant be decrypted. Commented Jul 23, 2012 at 13:06
  • 1
    I am using the TRIPLE_DES ENCRYPTION - blog.sqlauthority.com/2009/04/28/… Commented Jul 23, 2012 at 13:07
  • 1
    I am doing encryption at the database level. Please see the link in my previous comment Commented Jul 23, 2012 at 13:11
  • 3
    So just use a 3DES class that decrypts the data prior to displaying it, you probably know the key since someone must've set it (if not the encryption is useless)... see this link Commented Jul 23, 2012 at 13:13
  • 1
    @RemusRusanu, Ladislav's answer is probably better... :-) Commented Jul 23, 2012 at 13:54

1 Answer 1

2

If you are doing encryption on database level you must use database level for decryption - use ObjectContext.ExecuteStoreQuery<YourEntityType>(...) to load records from database - pass SQL command with correct decryption usage into that method.

Sign up to request clarification or add additional context in comments.

1 Comment

... and the correct decryption function is DECRYPTBYKEY

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.