• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1263
  • 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...

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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