Ejemplo n.º 1
0
 public static MD4 Create(string hashName)
 {
     object obj2 = CryptoConfig.CreateFromName(hashName);
     if (obj2 == null)
     {
         obj2 = new MD4Managed();
     }
     return (MD4) obj2;
 }
Ejemplo n.º 2
0
		public static new MD4 Create (string hashName) 
		{
			object o = CryptoConfig.CreateFromName (hashName);
			// in case machine.config isn't configured to use any MD4 implementation
			if (o == null) {
				o = new MD4Managed ();
			}
			return (MD4) o;
		}
Ejemplo n.º 3
0
        public new static MD4 Create(string hashName)
        {
            object obj = CryptoConfig.CreateFromName(hashName);

            if (obj == null)
            {
                obj = new MD4Managed();
            }
            return((MD4)obj);
        }
Ejemplo n.º 4
0
        public static new MD4 Create(string hashName)
        {
            object o = CryptoConfig.CreateFromName(hashName);

            // in case machine.config isn't configured to use any MD4 implementation
            if (o == null)
            {
                o = new MD4Managed();
            }
            return((MD4)o);
        }
		public void Setup () 
		{
			hash = new MD4Managed ();
		}
Ejemplo n.º 6
0
		static byte[] Compute_NTLM_Password (string password)
		{
			var buffer = new byte [21];

			// create NT password
#if MOONLIGHT
			MD4Managed md4 = new MD4Managed ();
#else
			MD4 md4 = MD4.Create ();
#endif
			byte[] data = ((password == null) ? (new byte [0]) : (Encoding.Unicode.GetBytes (password)));
			byte[] hash = md4.ComputeHash (data);
			Buffer.BlockCopy (hash, 0, buffer, 0, 16);
			
			// clean up
			Array.Clear (data, 0, data.Length);
			Array.Clear (hash, 0, hash.Length);

			return buffer;
		}
Ejemplo n.º 7
0
        static HashAlgorithm GetAlgorithm(string name)
        {
            HashAlgorithm alg = null;

            switch(name.ToLowerInvariant())
            {
                case "md2":
                    alg = new MD2Managed();
                    break;
                case "md4":
                    alg = new MD4Managed();
                    break;
                case "md5":
                    alg = new MD5CryptoServiceProvider();
                    break;
                case "sha1":
                    alg = new SHA1CryptoServiceProvider();
                    break;
                case "sha224":
                    alg = new SHA224Managed();
                    break;
                case "sha256":
                    alg = new SHA256CryptoServiceProvider();
                    break;
                case "sha384":
                    alg = new SHA384CryptoServiceProvider();
                    break;
                case "sha512":
                    alg = new SHA512CryptoServiceProvider();
                    break;
                case "xxhash32":
                    alg = new XXHash32();
                    break;
                case "xxhash64":
                    alg = new XXHash64();
                    break;
                default:
                    throw new ArgumentException(_("Invalid algorithm."));
            }
            return alg;
        }
Ejemplo n.º 8
0
 public TorrentBuild()
 {
     base.Load += new EventHandler(this.TorrentBuild_Load);
     this.TigerHash = new ThexThreaded();
     this.sha1 = new SHA1CryptoServiceProvider();
     this.md5 = new MD5CryptoServiceProvider();
     this.md4 = new MD4Managed();
     this.Advanced = new AdvancedConfiguration();
     this.Multitracker = new MultiTrackerGenerator();
     this.InitializeComponent();
 }