Encryption with the public / private key of the application in .net

-new- I found another use. Theres some data presented to me via HTTPS POST data, and I would like to save it in my db (for example, the name of the mother-maiden, which may be required to support customers, instead of spelling correctly if the hash matches). I only need this section, encrypted, and not the entire database, and using a separate database is probably not worth it. Question: How can I use a ready-made public key to encrypt a symmetric key + text using .NET? (the rest is for context, I just want a plz answer)

-edit- I already did symmetric encryption. How to encrypt a symmetric key with a public key? a good bonus is if you can tell me how to generate the public / private key in a separate application so that I can create them and store only the public key in my application.

I am considering the possibility of a cheaper, less loaded backup of the site from a more loaded site. Data transfer is not a problem since I can use https, but I'm not sure if my cheaper site will be just as safe or not have people searching for my files. Mostly I want to protect my email address and PM if I have them on the site.

So I'm wondering how I can have a public or private key in my application that encrypts data, so only I (or whoever I give out the key too) can decrypt the backup. How to do it in .NET. I can write the login and data transfer in a few minutes, but how can I encrypt the stream when I write it?

-edit- he just hit me. User / pass would not be a secret. Therefore, I would need to encrypt my backups before transferring. How to encrypt a symmetric public key using .NET. Then decrypt it on my side. Encrypting a file with a symmetric key, I know how to do this.

+5
source share
3 answers

: . . - , .

-, public/private key? / . ?

#, :

http://support.microsoft.com/kb/307010

:

, , , , , .

, . , , , . , . ? , , :

  • ,
  • - , , .., , , , .
  • -, - , , , ..

, . Crypto - , .

, , , . ; . , , , . ; . , , . - , , , , .

+14

, , . () , , . . , (pgp) (s-mime).

+1

(AES, DES, Triple-DES) ( nvarchar). - , - (, RSA, ElGamal ..). - RSA, - PGP.

But, no matter what algorithm you use, you need to make sure that your keys are as safe as possible, i.e. your symmetric key for AES and your private key for RSA, etc.

This article contains a tutorial on how to perform symmetric encryption with / without salt.

http://www.obviex.com/samples/Encryption.aspx

+1
source

All Articles