Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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?
Posted
Comments
Sergey Alexandrovich Kryukov 10-Mar-12 23:07pm    
C++/CLI? Tag it.
--SA
Sergey Alexandrovich Kryukov 10-Mar-12 23:12pm    
What's the difference Forms or not? And what's the problem, why could not your read C# article?
--SA
Sergey Alexandrovich Kryukov 10-Mar-12 23:57pm    
Please stop posting non-solutions as solution. I already provided nearly complete help for you. What do you mean "no"? Using the ready-to-use library is easy. What is your problem?

If you think someone would be interested to write some code for you, think -- why? It would be just boring, to start with. You are the one who is interested the most, why won't you do it?
--SA

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900