RsaProtectedConfigurationProvider与DataProtectionConfigurationProvider

pet*_*v_d 11 .net security encryption rsa data-protection

应该使用RsaProtectedConfigurationProvider而不是DataProtectionConfigurationProvider,反之亦然?

ole*_*sii 11

它们都提供强大的加密/解密功能.RsaProtectedConfigurationProvider使用非对称RSA,DataProtectionConfigurationProvider基于对称Windows(本机)Data Protection API.

这些提供程序可以在一台PC上互换使用.但是,如果您需要在多台计算机上使用相同的密钥(例如,您有一个Web场),那么您只能使用允许您导出/导入密钥的RSA提供程序.

非对称算法通常比对称慢得多,需要2个密钥:一个用于加密,另一个用于解密.对称算法通常非常快,但它们使用相同的单个密钥进行加密和解密.如果不经常读取文件,这些只是微小的差异.