Tag: sha512

Silverlight中的SHA512不可用,是否有可用的托管库?

Silverlight中缺少SHA512Managed (适用于Windows Phone 7 CTP SDK),只有SHA256可供使用。 有没有人知道我可以使用的.NET类提供了一个独立的C#或VB.net SHA512实现? 我需要使用它来validationHTTP Web服务。

C#相当于PHP中的hash_hmac

使用.NET和C#我需要使用HMAC SHA512为PHP服务器提供完整性字符串。 在C#中使用: Encoding encoding = Encoding.UTF8; byte[] keyByte = encoding.GetBytes(key); HMACSHA512 hmacsha512 = new HMACSHA512(keyByte); byte[] messageBytes = encoding.GetBytes(message); byte[] hashmessage = hmacsha512.ComputeHash(messageBytes); return(ByteToString(hashmessage).toUpper()); 但它与PHP hash_hmac()PHP代码不匹配: $hmac = strtoupper(hash_hmac($pbx_hash, $msg, $binKey)); 我尝试用C#(utf8,ASCII,Unicode)改变编码而没有成功。 我已尝试在网上找到许多解决方案,但没有给出相同的字符串:( 我无法更改PHP代码,也看不到C#中的错误 编辑这是ByteToString (从评论中复制): static string ByteToString(byte[] buff) { string sbinary = “”; for (int i = 0; i < buff.Length; i++) […]