Solved

encrypt to file using public key

Posted on 2011-09-09
5
310 Views
Last Modified: 2012-05-12
In C# I want to send sensitive data to a file to be stored in an encrypted form. Later I want to be able to decrypt the file.

I'm thinking of using private/public key encryption, since if I just used simple key encryption, someone could probably find the key in the compiled executable.

Looking for a simple example demonstrating how to do this:

1. Make Public/Private key pair

2. Simple C# program that uses Public Key to encrypt lines of text sent to file. (Resulting file probably a binary file, not a text file.)

3. Another simple program that decrypts file using private key

0
Comment
Question by:deleyd
5 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 36514765
How about just using single-key encryption but do NOT store it.  Instead, prompt for the password every time.
0
 

Author Comment

by:deleyd
ID: 36517182
It has to be done behind the scenes. User doesn't know anything about it. I'm logging program performance, but some of the data contains company proprietary secrets of how the innards work, so it must be encrypted.
0
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 36557314
Hope below should link should help you. Second option should be enough for your case i guess.

http://www.codeproject.com/KB/security/SimpleEncryption.aspx
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

758 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

25 Experts available now in Live!

Get 1:1 Help Now