• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

encrypt to file using public key

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
deleyd
Asked:
deleyd
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
How about just using single-key encryption but do NOT store it.  Instead, prompt for the password every time.
0
 
deleydAuthor Commented:
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
 
apeterCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now