문제

I am looking for a way to do private key encryption in C#.

I thought I could use the RSACryptoServiceProvider, but it only supports public key encryption.

The only thing I found on the subject was this project, but I would rather use something I can find in .net: http://www.codeproject.com/KB/security/PrivateEncryption.aspx

Please note I am not looking for signing.

Please note I require asymmetric encryption.

Any idea's?

Background story:

I am sending an encrypted file to another system which is running an application. The encryption is making sure the file cannot be altered (more or less) or viewed by anyone. The application is able to decrypt the file using the public key and do something with it.

I know pretty much anyone is able to get the public key from the application, this is not a problem in this case.

도움이 되었습니까?

해결책 2

It should not be done. Sign instead and use symmetric encryption.

다른 팁

The encryption is making sure the file cannot be altered or viewed by anyone

Public Key Encryption - when done "by the book" - seperates encryption and signing ("cannot be altered"). In your case, use two key pairs, one within the application and one at your site. Encrypt the file using the public application key and sign the file using your private one.

This is a really widespread usage, I even like to call it "Best practice". As for the downvote, I can only guess that ruling out signing in your question triggered this.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top