Which built-in .NET cryptography algorithm is the most secure?

前端 未结 2 1071
一个人的身影
一个人的身影 2021-02-07 16:35

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

相关标签:
2条回答
  • 2021-02-07 17:00

    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:

    • 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

    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.

    0 讨论(0)
  • 2021-02-07 17:01

    I'm somewhat partial to SHA-512. If 512 is a little excessive, the other members of the SHA-2 family might be helpful - SHA-256 and SHA-384 are both in the SHA-2 family. But AviewAnew's suggestion of AES 256 is good as well.

    0 讨论(0)
提交回复
热议问题