源代码在Winform vc ++中获取文件的md5? [英] Source code get md5 of a file in Winform vc++?

查看:78
本文介绍了源代码在Winform vc ++中获取文件的md5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Winform vc ++中编码文件的md5,但在Soure代码中,它只是在c#中具有代码.
此处:获取以下项的MD5和SHA-1(SHA1):任何文件 [ ^ ]
那么,如何在vc ++ winform中使用此代码呢?

I want to code md5 of a file in winform vc++ but in Soure code,it''s just have code in c#
here:Get MD5 and SHA-1 (SHA1) of any file[^]
So how can i do like this code in vc++ winform?

推荐答案

只需使用类System.Security.Cryptography::MD5和此文档页面:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx#Y0 [ ^ ].

请记住:出于任何安全目的,请勿使用MD5(顺便说一下,SHA-1),因为此算法已损坏.
请参阅:
http://en.wikipedia.org/wiki/MD5 [ http://en.wikipedia.org/wiki/Sha-1 [ http://en.wikipedia.org/wiki/Sha-2 [ http://msdn.microsoft.com/en-us/library/system. security.cryptography.hashalgorithm.aspx [ ^ ].

—SA
Just use the class System.Security.Cryptography::MD5 and this documentation page:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx#Y0[^].

Remember: you should not use MD5 (and, by the way, SHA-1) for any security purposes — this algorithm is broken.
Please see:
http://en.wikipedia.org/wiki/MD5[^],
http://en.wikipedia.org/wiki/Sha-1[^].

If this is for security, better use one of the algorithms from SHA-2 family. Please see:
http://en.wikipedia.org/wiki/Sha-2[^].

They are all already implemented in .NET. Please see:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.hashalgorithm.aspx[^].

—SA


这篇关于源代码在Winform vc ++中获取文件的md5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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