0

Hello i am looking for a md5 hash function for windows 8 (metro app)

I have been looking for this in google (and other search engines) but there is nothing for windows 8 , most of them are about win 7 (or older)

thank you any way :)

Dimitris Sapikas
  • 622
  • 1
  • 6
  • 22
  • Possible duplicate of [Compute MD5 on Metro Style app in C#](http://stackoverflow.com/questions/8297627/compute-md5-on-metro-style-app-in-c-sharp) – this should be applicable to VB.NET as well, apart from minor syntactic differences. – Joey Jun 29 '12 at 11:01
  • But it is not even answered !!! I can find nowere any type of hashes on windows 8 !! "Windows.Security.Cryptography.Certificates" has no hash properties :S – Dimitris Sapikas Jun 29 '12 at 11:36
  • If doing this for security, be aware that MD5 isn't very secure. – jmoreno Jul 03 '12 at 02:31

1 Answers1

1

I didn't find MD5 but i find for SHA256 here is some sample if you are interested in ;)

Function sha512(Key As String)
    Dim hash As String
    Dim strAlgName As String = "SHA512"
    Dim objAlgProv As HashAlgorithmProvider = HashAlgorithmProvider.OpenAlgorithm(strAlgName)
    Dim objHash As CryptographicHash = objAlgProv.CreateHash()
    Dim buffMsg1 As IBuffer = CryptographicBuffer.ConvertStringToBinary(Key, BinaryStringEncoding.Utf16BE)
    objHash.Append(buffMsg1)
    Dim buffHash1 As IBuffer = objHash.GetValueAndReset()
    Dim strHash1 As String = CryptographicBuffer.EncodeToBase64String(buffHash1)
    hash = strHash1
    Return hash
End Function
Dimitris Sapikas
  • 622
  • 1
  • 6
  • 22