Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are there multiple different hashing algorithm providers in System.Security.Cryptography?

As documented by MSDN, there are several providers for many of the different hashing algorithms (e.g. MD5, SHA, RIPE). For each of the algorithms, any available implementation seems to fall into 1 of 3 categories:

  • [Algo]Cng
  • [Algo]CryptoServiceProvider
  • [Algo]Managed

Why are there multiple implementations of any of these hashing algorithms?

What are the differences between the implementations?

What are the practical differences when choosing which implementation to utilize in an application?

References:

http://msdn.microsoft.com/en-us/library/system.security.cryptography.aspx

like image 600
Zach Burlingame Avatar asked Oct 22 '08 02:10

Zach Burlingame


1 Answers

  • [Algo]Managed is a pure-IL implementation of the algorithm.
  • [Algo]CryptoServiceProvider delegates to CAPI, which allows you to use things such as hardware crypto devices.
  • [Algo]Cng uses Cryptography API: Next Generation (CNG) which is designed to be a replacement for CAPI but is only supported in Vista and Server 2008.
like image 86
Ignacio Vazquez-Abrams Avatar answered Sep 30 '22 14:09

Ignacio Vazquez-Abrams