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

c# how can I encrypt/decrypt a string to save into sql.

How can I encrypt data and send it into sql for storage...then later query that data decrypt it and present the value.

I dont mean I need to know who to read and write from SQL..but rather how can I encrypt say a string value so I can save teh encrypted value to a table..then later decrypt that same value aftre retriveing it from the database.

I need a c# solution. Either code or at least a document that explains how to do this. I am NOT talking about encryption teh web config connection string...

0
Prysson
Asked:
Prysson
2 Solutions
 
Jens FiedererCommented:
The normal Microsoft documentation for the CryptoStream class gives you a pretty good example (code), as well as detailed information.
0
 
manjunathcvCommented:
i recently came across this situation and  here is the sample code

http://probedeep.blogspot.com/2008/10/simple-password-string-encryption-and.html
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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