其中内置的.NET加密算法是最安全的? [英] Which built-in .NET cryptography algorithm is the most secure?

查看:210
本文介绍了其中内置的.NET加密算法是最安全的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其中密码算法是最安全的附带.NET?

Which cryptography algorithm is the most secure that ships with .net?

推荐答案

您不能直接比较各类型的加密算法。这就好比一个排序算法与乘算法进行比较:他们有不同的用途。 话虽这么说,我会回答:

You cannot directly compare all types of cryptographic algorithms. That would be like comparing a sorting algorithm with a multiplication algorithm: they have different purposes. That being said, I would answer:

  • 对称加密:<一href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.aesmanaged.aspx">AES-256
  • 非对称密码:<一href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider.aspx">RSA与4096位密钥(我相信这是在.NET中的最大值)或 ECDSA 与571位密钥(但只支持.NET 3.5)
  • 哈希:<一href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx">SHA-512
  • 在消息验证code: HMAC与SHA-512
  • Symmetric cipher: AES-256
  • Asymmetric cipher: RSA with 4096 bit key (I believe that is the maximum in .NET) or ECDSA with 571 bit key (but that is only supported in .NET 3.5)
  • Hash: SHA-512
  • Message Authentication Code: HMAC with SHA-512

话虽这么说,这些都是矫枉过正的大多数应用程序,你应该用做精AES-128,RSA 2048位的密钥,SHA-256和HMAC使用SHA-256。

That being said, those are overkill for most applications, and you should do fine using AES-128, RSA with 2048 bit key, SHA-256 and HMAC with SHA-256.

这篇关于其中内置的.NET加密算法是最安全的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆