3 ms·
MD5 is quite a bit faster on my machine. % for i in md5 sha1 sha256 sha512; do echo -n "$i: "; time ${i}sum test.bin > /dev/null ; done md5: ${i}sum test
by boring_twenties 5y ago
MD5 is quite a bit faster on my machine.
% for i in md5 sha1 sha256 sha512; do echo -n "$i: "; time ${i}sum test.bin > /dev/null ; done
md5: ${i}sum test.bin > /dev/null 1.37s user 0.13s system 99% cpu 1.501 total
sha1: ${i}sum test.bin > /dev/null 1.84s user 0.12s system 99% cpu 1.952 total
sha256: ${i}sum test.bin > /dev/null 4.43s user 0.16s system 99% cpu 4.593 total
sha512: ${i}sum test.bin > /dev/null 2.69s user 0.12s system 99% cpu 2.810 total
Surprisingly, SHA256 is much slower than SHA512 here.
- mlyle 5y agoOK, I measured a dozen machines, and I found a very mixed picture using 'openssl speed'. - Lots of modern x86 machines with SHA-NI that were typically 50-300% faster than MD5 - Older Intel machines, where SHA1 was generally slightly faster, with one or two exceptions where the reverse was true. - ARM machines with good SIMD/NEON where the NEON implementation of SHA1 was 30-40% faster than MD5. - Embedded ARM machines with bad SIMD/NEON where it was pretty much a tie. - A few ARM machines-- most notably Broadcom chipsets in the Raspberry Pi, where MD5 wins big a large margin. - Embedded MIPS 24k, where MD5 won by 33%. Then I found http://bench.cr.yp.to/results-hash.html http://bench.cr.yp.to/results-hash.html , which bears out what I'd measured. In any case, I don't think "speed" is any reason to select MD5, unless maybe if you're on MIPS 24k.
- thomashabets2 5y agoIt's not about speed. It's about kernel support. And RFC2385 has kernel support and TCP-AO does not. See other comments.
- NovemberWhiskey 5y ago>Surprisingly, SHA256 is much slower than SHA512 here. SHA512 is expected to be faster than SHA256 on modern 64 bit architectures due to fewer rounds per byte.
- boring_twenties 5y agoThanks. Shows how much I know! At least I am kind of handy with the shell...