Couldnt get hashes of some algorithms
Status: Beta
Brought to you by:
alt_mux
I couldnt get the hashes with the next algorithms:
BlowFish, DES, LanMan
With LanMan i also got a Null Reference Exception.
The others algorithms work nice.
This is my test code:
CryptServiceProvider test = (new
CryptServiceProvider()).GetCryptServiceProvider(Algorithm.HashType.LM);
Console.WriteLine(test.Encrypt("david"));
BTW: Excellent work!
Logged In: YES
user_id=1520034
CryptoServiceProvider class was implemented using a factory
method pattern so the the correct implementation of that is:
CryptServiceProvier ea = new CryptServiceProvier();
HashAlgorithm eaea = ea.GetCryptServiceProvier(Algorithm.LM);
Console.WriteLine(ea.Encrypt("david"));
eaea = ea.GetCryptServiceProvider(Algorithm.NTLM);
Console.WriteLine(ea.Encrypt("david));
Also, you should remember that some algorithms like Blowfish
or DES need a proper salt. The next version include a
Password and salt generator for this problem.
Was having the same problem using the 3.0 code. Unlike the other algorithms, for lanman it needs to be (Algorithm.LM | Algorithm.NTLM)
Example:
CryptAPI.CryptServiceProvider csp = new CryptAPI.CryptServiceProvider();
CryptAPI.HashAlgorithm lm = csp.GetCryptServiceProvider(CryptAPI.Algorithm.LM | CryptAPI.Algorithm.NTLM);
Console.WriteLine(lm.Encrypt("david");