Solved

encrypt to file using public key

Posted on 2011-09-09
5
311 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

937 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

11 Experts available now in Live!

Get 1:1 Help Now