Solved

encrypt to file using public key

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

786 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