Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. String clearKey = "test";
  2. IBuffer buffEntry = CryptographicBuffer.ConvertStringToBinary(clearKey, BinaryStringEncoding.Utf8);
  3. HashAlgorithmProvider algProvider = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5);
  4.  
  5. IBuffer buffHashed = algProvider.HashData(buffEntry);
  6.  
  7. byte[] bytesKey;
  8. CryptographicBuffer.CopyToByteArray(buffHashed, out bytesKey);
  9. Debug.WriteLine(String.Format("bytesKey lenght : {0}", bytesKey.Length));
  10.  
  11. string md5Hex = CryptographicBuffer.EncodeToHexStringbuffHashed(buffEntry);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement