Solved

encrypt to file using public key

Posted on 2011-09-09
5
325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 86

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
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…
Six Sigma Control Plans

636 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