Solved

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

Posted on 2007-03-23
3
1,247 Views
Last Modified: 2008-10-29
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
Comment
Question by:Prysson
3 Comments
 
LVL 23

Assisted Solution

by:Jens Fiederer
Jens Fiederer earned 50 total points
Comment Utility
The normal Microsoft documentation for the CryptoStream class gives you a pretty good example (code), as well as detailed information.
0
 
LVL 4

Accepted Solution

by:
g_johnson earned 450 total points
Comment Utility
0
 

Expert Comment

by:manjunathcv
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now