コード例 #1
0
ファイル: MD4.cs プロジェクト: dwbuiten/EAD-TorrentBuild
 public static MD4 Create(string hashName)
 {
     object obj2 = CryptoConfig.CreateFromName(hashName);
     if (obj2 == null)
     {
         obj2 = new MD4Managed();
     }
     return (MD4) obj2;
 }
コード例 #2
0
ファイル: MD4.cs プロジェクト: calumjiao/Mono-Class-Libraries
		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;
		}
コード例 #3
0
        public new static MD4 Create(string hashName)
        {
            object obj = CryptoConfig.CreateFromName(hashName);

            if (obj == null)
            {
                obj = new MD4Managed();
            }
            return((MD4)obj);
        }
コード例 #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);
        }
コード例 #5
0
		public void Setup () 
		{
			hash = new MD4Managed ();
		}
コード例 #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;
		}
コード例 #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;
        }
コード例 #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();
 }