{"id":21963,"date":"2008-06-13T10:00:00","date_gmt":"2008-06-13T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2008\/06\/13\/dont-be-helpless-you-can-find-information-too-if-you-try\/"},"modified":"2008-06-13T10:00:00","modified_gmt":"2008-06-13T10:00:00","slug":"dont-be-helpless-you-can-find-information-too-if-you-try","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20080613-00\/?p=21963","title":{"rendered":"Don&#039;t be helpless: You can find information, too, if you try"},"content":{"rendered":"<p>\nHere&#8217;s a question that floated past my view:\n<\/p>\n<blockquote CLASS=\"q\"><p>\nAnybody know if there exists a library for computing MD5 hashes\nfrom unmanaged code?\nMSDN has information about .NET classes,\nbut nothing about the unmanaged side.\n<\/p><\/blockquote>\n<p>\nHm, let&#8217;s see.\n<\/p>\n<pre>\nC:\\Windows SDK\\Include&gt; grep MD5 *.h\nwincrypt.h:#define ALG_SID_MD5                     3\nwincrypt.h:#define ALG_SID_SSL3SHAMD5              8\nwincrypt.h:#define CALG_MD5                (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)\nwincrypt.h:#define CALG_HUGHES_MD5         (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_ANY|ALG_SID_MD5)\nwincrypt.h:#define CALG_SSL3_SHAMD5        (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)\nwincrypt.h:#define KP_PRECOMP_MD5          24\nwincrypt.h:#define szOID_RSA_MD5RSA        \"1.2.840.113549.1.1.4\"\nwincrypt.h:#define szOID_RSA_MD5           \"1.2.840.113549.2.5\"\n<\/pre>\n<p>\nWow, those hits sure look promising.\nPerhaps a search on\n<a HREF=\"http:\/\/search.live.com\/results.aspx?q=site:microsoft.com+CALG_MD5\">\nWindows Live<\/a>\nor\n<a HREF=\"http:\/\/www.google.com\/search?hl=en&amp;q=site:microsoft.com+CALG_MD5\">\nGoogle<\/a>&sup1; will turn up something.\nOh hey, how about that,\n<a HREF=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms867086.aspx\">\nsample code<\/a>.\n<\/p>\n<p>\n<b>Exercise<\/b>:\nUse this exact same technique to answer\n<a HREF=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/08\/14\/4374222.aspx#4394614\">\nthis commenter&#8217;s question<\/a>\non how the C# <code>++<\/code> operator works.\nHint:\nSince this is a question about the C# language,\n<a HREF=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/aa645596(VS.71).aspx\">\nthe C# language specification<\/a>\nwould be a good starting point.\n<\/p>\n<p>\n<b>Exercise<\/b>:\nUse this technique to answer\n<a HREF=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/11\/06\/5924058.aspx#5950892\">\nthis commenter&#8217;s question<\/a>\non how to connect to a process as a debugger.\n<\/p>\n<p>\n<b>Footnotes<\/b>\n<\/p>\n<p>\n&sup1;<a HREF=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/07\/30\/4123208.aspx#4142579\">\nOH MY GOD<\/a>\n<a HREF=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/07\/30\/4123208.aspx#4154133\">\nI LINKED TO GOOGLE<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a question that floated past my view: Anybody know if there exists a library for computing MD5 hashes from unmanaged code? MSDN has information about .NET classes, but nothing about the unmanaged side. Hm, let&#8217;s see. C:\\Windows SDK\\Include&gt; grep MD5 *.h wincrypt.h:#define ALG_SID_MD5 3 wincrypt.h:#define ALG_SID_SSL3SHAMD5 8 wincrypt.h:#define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5) [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-21963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>Here&#8217;s a question that floated past my view: Anybody know if there exists a library for computing MD5 hashes from unmanaged code? MSDN has information about .NET classes, but nothing about the unmanaged side. Hm, let&#8217;s see. C:\\Windows SDK\\Include&gt; grep MD5 *.h wincrypt.h:#define ALG_SID_MD5 3 wincrypt.h:#define ALG_SID_SSL3SHAMD5 8 wincrypt.h:#define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5) [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/21963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=21963"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/21963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=21963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=21963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=21963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}