kingdango
kingdango

Reputation: 3999

How should I secure the Private Key when using Asymmetric RSA encryption?

I am using the RSACryptoServiceProvider and C#. I have a web server (A) that will be encrypting data and storing it in a database. I have another server (B) that will be reading the encrypted data and decrypting it. The private key will only ever live on server B.

I would like to limit private key access to my application and a very short list of domain users.

What is the best way to store the key so that it is safe from compromise by an unauthorized person?

Upvotes: 1

Views: 458

Answers (1)

Davin Tryon
Davin Tryon

Reputation: 67326

You can use Windows RSA Key containers to store the key. The key can be installed / created by the aspnet_regiis.exe tool that ships with the .NET framework.

Here is a walkthrough.

The two options to look out for are:

-pi (installs a key to the RSA container)

-pa (managements permissions for the key)

Upvotes: 2

Related Questions