Why is a cryptographic hash function generally faster to execute in software than conventional encryption algorithms such as DES?
The speed of individual algorithms strongly depends on their implementation. This goes for both hashing algorithms as well as encryption algorithms. This quickly becomes clear if you take a look at efforts like “eBACS: ECRYPT Benchmarking of Cryptographic Systems” and the results presented.
Also, you should not ignore that some algorithms have specifically been created with an eye on hardware implementation, while others were created with the clear goal of software implementation. This can result in the fact that an algorithm which was actually meant to be implemented in hardware, shows a low speed performance when being implemented and benchmarked as software version.
Therefore, you can not generally assume one algorithm to be slower or faster than another, without looking at their actually assumed implementation. Anything else practically results in rather incorrect (better: rather unfair) benchmarks.
Looking at DES
As you´ve mentioned DES… DES shows a bad performance as software implementation because it was intended to be implemented in an application-specific integrated circuit (ASIC). When you look at hardware designs of DES, you´ll see it perform pretty well in relation to speed.
Of course, things like its successor – AES – for example are able to beat DES out of the water both as hard and software implementation. But you have to remember that the Data Encryption Standard has been created more than 2 decades ago. As technology evolved, so did cryptographic algorithms.
Is it fair to compare DES with encryption algorithms like AES?
Not really. AES (First published in 1998) came around and about 20 years later than DES (First published in 1975, standardized in January 1979). In those 2 decades, both hardware as well as software evolved… and the creators of AES surely had the benefit of being able to look back at DES and its issues (both in relation to cryptanalysis as well as in relation to different implementations).
Is it fair to compare DES with hashing algorithms like SHA2?
Same as before: not really. SHA2 (First published in 2001) benefitted from similar things like AES. While we now may have access to cool things like personal computers et al, things looked quite different back in the 70´s… not only from a technological point of view. While DES includes several bit-oriented operations, SHA2 (and AES) were clearly designed with modern CPUs in mind, which logically results in better performance on modern computer systems (which they were designed for).
Wrapping it up
Whenever you compare speeds and something outperforms something else, the reason might be as simple as the fact that one of them is older and therefore slower due to not being as advanced as what you´re comparing it to.
In relation to cryptographic algorithms, looking at individual publication dates can tell a whole story…