Пример #1
0
        protected override byte[] HashFinal()
        {
            byte[] output = new byte[dig.GetDigestSize()];
            dig.DoFinal(output, 0);

            return(output);
        }
Пример #2
0
 ////////////////////////////////////////////////////////////////////////////////
 //
 ////////////////////////////////////////////////////////////////////////////////
 internal static Byte[] GenerateNTLM(String password)
 {
     Byte[] bPassword = Encoding.Unicode.GetBytes(password);
     Org.BouncyCastle.Crypto.Digests.MD4Digest md4Digest = new Org.BouncyCastle.Crypto.Digests.MD4Digest();
     md4Digest.BlockUpdate(bPassword, 0, bPassword.Length);
     Byte[] result = new Byte[md4Digest.GetDigestSize()];
     md4Digest.DoFinal(result, 0);
     return(result);
 }
Пример #3
0
        public static byte[] MyHash(byte[] input)
        {
            Org.BouncyCastle.Crypto.Digests.MD4Digest dig = new Org.BouncyCastle.Crypto.Digests.MD4Digest();

            byte[] output = new byte[dig.GetDigestSize()];

            dig.BlockUpdate(input, 0, input.Length);
            dig.DoFinal(output, 0);

            return(output);
        }
Пример #4
0
 ////////////////////////////////////////////////////////////////////////////////
 //
 ////////////////////////////////////////////////////////////////////////////////
 public static void GenerateNTLMString(String password)
 {
     try
     {
         Byte[] bPassword = Encoding.Unicode.GetBytes(password);
         Org.BouncyCastle.Crypto.Digests.MD4Digest md4Digest = new Org.BouncyCastle.Crypto.Digests.MD4Digest();
         md4Digest.BlockUpdate(bPassword, 0, bPassword.Length);
         Byte[] result = new Byte[md4Digest.GetDigestSize()];
         md4Digest.DoFinal(result, 0);
         Console.WriteLine(BitConverter.ToString(result).Replace("-", ""));
     }
     catch (Exception ex)
     {
         Console.WriteLine("[-] Unhandled Exception Occured");
         Console.WriteLine("[-] {0}", ex.Message);
     }
 }