2008/6/5 Aidan Skinner <[EMAIL PROTECTED]>:

> I am clearly losing it, but this program:

This isn't quite the same as the Java. Here is my version:

char[] hexkey = new char[]{(char) 0x08, (char)0x4e, (char)0x03, (char)0x43,
                                           (char)0xa0, (char)0x48, (char)0x6f, 
(char)0xf0,
                                   (char)0x55, (char)0x30, (char)0xdf,
(char)0x6c,
                                   (char)0x70, (char)0x5c, (char)0x8b,
(char)0xb4};
            UTF8Encoding encoding = new UTF8Encoding();
            byte[] key = encoding.GetBytes(hexkey);
            Console.Out.WriteLine("Key: {0}", HexToString(key));
            HMAC hmac = new HMACMD5(key);
            byte[] value =
encoding.GetBytes("<[EMAIL PROTECTED]>");
            Console.Out.WriteLine("Value: {0}", HexToString(value));
            byte[] result = hmac.ComputeHash(value);
            Console.Out.WriteLine("Values: {0}", HexToString(result));


>            byte[] hexkey = new byte[]{0x08, 0x4e, 0x03, 0x43,
>                                           0xa0, 0x48, 0x6f, 0xf0,
>                                   0x55, 0x30, 0xdf, 0x6c,
>                                   0x70, 0x5c, 0x8b, 0xb4};
>
>                byte[] key =
> System.Text.UTF8Encoding.UTF8.GetBytes(System.Text.UTF8Encoding.UTF8.GetString(hexkey));

What are you expecting this to do? Return the original byte array? Is
the original byte array a valid UTF-8 encoding?

RG

Reply via email to