hashalgorithm

.NET: Disposing a HashAlgorithm object

Objects that derive from HashAlgorithm such as MD5CryptoServiceProvider have a Dispose() method, but it's private. Instead it has a Clear() method which "Releases all resources" used by it. WTF? Is this how to correctly dispose of a HashAlgorithm then? var hasher = new MD5CryptoServiceProvider(); byte[] hashCode = hasher.ComputeHash(...

FIPS-compliant HashAlgorithm on WinXP?

How can I use C# on a FIPS-compliant WinXP SP2 box to uniquely hash the contents of a given file? I'm not concerned about performance (yet?). Hopefully someone can point out an exception to the "rule", but it seems that the "*ServiceProvider" classes are FIPS-compliant and unavailable on WinXP, while the "*Managed" classes are availabl...

hashing password giving different results

I am taking over a system that a previous developer wrote. The system has an administrator approve a user account and when they do that the system uses the following method to hash a password and save it to the database. It sends the unhashed password to the user. When the user logs in the system uses the exact same method to hash wha...

Why isnt HashAlgorithm.Dispose public?

Why isnt HashAlgorithm.Dispose public? void IDisposable.Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } I understand that it is and explicit interface implementation and can still be called. I am trying to work out what the reasoning is behind it. ...

Why is ComputeHash not acting deterministicly?

I've run into an interesting issue.. It seems that ComputeHash() for a "HMACSHA256" hash is not behaving deterministicly.. if I create two instances of HashAlgorithm using HashAlgorithm.Create("HMACSHA256").. And run ComputeHash, I get two different results.. below is an example static class that exhibiting this behavior. internal s...

How to switch hash_algos() on ? I'm with Php 5.2.11

My PHP version is 5.2.11 which is higher than the required version for hash_algos. however, when I run it either via web or command line, it returns Fatal error: Call to undefined function hash_algos() So as for other Hash functions. Do i have to turn anything on in the php.inin or what should I do? I have checked the php --re has...

what is the criteria to choose encryption algorithm for my system

I am working on a system which is going to be applied in the real environment. I need to make high security mechanism for the system, one of them is encryption for user's passwords in my database. I prefer to use one way encryption method to two way encryption, the problem is I want to choose a good algorithm which has good performance ...