为什么会出现在.NET框架没有管理MD5执行? [英] Why is there no managed MD5 implementation in the .NET framework?

查看:115
本文介绍了为什么会出现在.NET框架没有管理MD5执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(重新编写的问题,请参见历史原件)。

现在的问题是正确的,在标题。

The question is right there in the title.

为什么会出现在.NET框架没有管理MD5实现?

我专门谈论的单纯的管理code 执行MD5算法的,不.NET框架中存在。

I'm specifically talking about a purely managed code implementation of the MD5 algorithm, which does not exist within the .NET framework.

在System.Security.Cryptography命名空间,我知道的的 MD5 的抽象基类(其中有被继承,不能被用作是),而我也知道的的 MD5CryptoServiceProvider 的和的 MD5CNG 的这两者分别提供来自OS的基础的CSP(加密服务提供商)和(CNG下一代加密)供应商实现方式中,然而,这两种实现都< STRONG>非托管 code。

Within the System.Security.Cryptography namespace, I am aware of the MD5 abstract base class (which has to be inherited and can't be used as is), and I'm also aware of MD5CryptoServiceProvider and MD5CNG which both provide implementations from the OS's underlying CSP (Crypto Service Provider) and CNG (Cryptography Next Generation) providers respectively, however, both of these implementations are unmanaged code.

更新ON解答:
我AP preciate的是,虽然有的的一真回答对这个问题,我们(SO社区)可能不知道它,除非微软框架设计者(或某人谁直接就得到一个)是这个社会,然而,很多人都提供了非常合理的猜测的一部分,以该走进但是省略了管理MD5实现的框架下,思考,我还是想知道,如果有人不知道真正的这个问题的答案。

UPDATE ON ANSWERS:
I appreciate that, whilst there should be "one true answer" to this question, we (the SO community) may not know it unless a Microsoft framework designer (or someone who knows one directly) is part of this community, however, many people have offered very reasonable "educated guesses" as to the thinking that went into omitting a managed MD5 implementation from the framework, however, I'm still curious to know if anyone does know the "real" answer to this question.

推荐答案

由于我没有设计的框架,我不能肯定地说,但我相信,他们可能并没有以阻止其使用的麻烦安全方面的原因。

Since I didn't design the framework, I can't say for sure, but I believe they probably didn't bother in order to discourage its use for security reasons.

我原本认为,非托管的执行速度会更快,但我们现在知道,情况并非如此,请参阅: HTTP:/ /stackoverflow.com/a/14850676/58391

I had originally believed that the unmanaged implementation would be faster, but we now know that is not the case, see: http://stackoverflow.com/a/14850676/58391

我的下一个最好的猜测对准什么帕维尔说,在上述评论。正如在.NET和C#大部分功能,有可能只是没有足够的利益超过代价来实现,测试和出货的功能时,底层的非托管的一个已经是足够好的。

My next best guess aligns with what Pavel says in the comments above. As with most features in .NET and C#, there probably just wasn't enough benefit over cost to implement, test, and ship the feature when the underlying unmanaged one was already good enough.

这将是有趣的,看看一个真正的答案,虽然从别人谁设计的语言。

It would be interesting to see a real answer though from someone who designed the language.

这篇关于为什么会出现在.NET框架没有管理MD5执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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