Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RsaProtectedConfigurationProvider vs DataProtectionConfigurationProvider

What are the cases when RsaProtectedConfigurationProvider should be used instead DataProtectionConfigurationProvider and vice-versa?

like image 566
petkov_d Avatar asked Jul 30 '11 07:07

petkov_d


1 Answers

They both offer strong encryption/decryption. RsaProtectedConfigurationProvider uses asymmetric RSA, and DataProtectionConfigurationProvider is based on the symmetric Windows (native) Data Protection API.

These providers can be used interchangeably on a single PC. However, if you need to use the same key on several machines (e.g. you have a web farm), then you can only use RSA provider which allows you to export/import the key.

Asymmetric algorithms are usually much slower than symmetric and require 2 keys: one to encrypt, another to decrypt. Symmetric algorithms are usually exceptionally fast, but they encrypt and decrypt using the same single key. These are just minor differences if the file is read infrequently.

like image 58
oleksii Avatar answered Oct 12 '22 09:10

oleksii