예제 #1
0
        public void TestByteArrays()
        {
            Assert.Equal(new byte[] { 0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31, 0xb7, 0x3c, 0x59, 0xd7, 0xe0, 0xc0, 0x89, 0xc0 },
                         Md4.ComputeHash(new byte[0]));

            Assert.Equal(new byte[] { 0xd9, 0x13, 0x0a, 0x81, 0x64, 0x54, 0x9f, 0xe8, 0x18, 0x87, 0x48, 0x06, 0xe1, 0xc7, 0x01, 0x4b },
                         Md4.ComputeHash(Encoding.ASCII.GetBytes("message digest")));

            Assert.Equal(new byte[] { 0x04, 0x3f, 0x85, 0x82, 0xf2, 0x41, 0xdb, 0x35, 0x1c, 0xe6, 0x27, 0xe1, 0x53, 0xe7, 0xf0, 0xe4 },
                         Md4.ComputeHash(Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")));
        }
예제 #2
0
 public static byte[] GetNtPasswordHash(SecureString password)
 {
     return(Md4.ComputeHash(GetNtPasswordBuffer(password)));
 }