Reputation: 1713
How long does a SHA1 hash take to generate (for about 60 bytes?)
And compared to other hashes?
Thanks in advance.
Upvotes: 2
Views: 11251
Reputation: 44909
Of course, the actual time taken to generate the hash will depend greatly upon your hardware, so specific timings are impossible to provide.
That said, it's possible to indicate the performance of the SHA1 hash algorithm relative to other hash algorithms.
The following links provide performance comparisons of many different popular hash algorithms:
MD5 vs. SHA-1, Performance & Pedigree
Performance Comparison: Security Design Choices
(Check about half way down, under the heading "ComputeHash")
From the last link:
ComputeHash
The method computes the hash of data stored in a file. We performed the tests with a data size of 4 KB, 135 KB, and 1 MB to see how the size of data impacts performance.
Figure 4. Hash algorithms (4 KB): RPS and response time
Note:
.NET Framework supports various hash algorithms including MD5, SHA1, SHA256, SHA384, and SHA512. The only difference between the various SHA implementations is the hash size that they produce. We opted to include only SHA1 and SHA512 in our tests. We used System.Security.Cryptography that provides various implementations of SHA1 and MD5. There is just one implementation of MD5 available in System.Security.Cryptography: MD5CryptoServiceProvider that wraps CAPI. SHA256, SHA384 and SHA512 are not currently available in CryptoAPI. These algorithms are implemented directly in managed code. These algorithms have been added just to support the new key generation requirements of AES, not to provide stronger algorithms than SHA1. The current belief is that SHA1 is more than adequate for hashing data. For SHA1 and SHA512, we used managed implementations, SHA1Managed and SHA512Managed, respectively, available in System.Security.Cryptography. As shown in Figure 4, all the algorithms are very similar in performance with SHA512 slightly behind. MD5 produces a hash of size 128 bits. The computation process in SHA is very much modeled after MD5. It produces a 160-bit hash.
Upvotes: 6