cryptography - Is calculating an MD5 hash less CPU intensive than SHA family functions? -


is calculating md5 hash less cpu intensive sha-1 or sha-2 on "standard" laptop x86 hardware? i'm interested in general information, not specific chip.

update: in case, i'm interested in calculating hash of file. if file-size matters, let's assume 300k.

yes, md5 less cpu-intensive. on intel x86 (core2 quad q6600, 2.4 ghz, using 1 core), in 32-bit mode:

md5       411 sha-1     218 sha-256   118 sha-512    46 

and in 64-bit mode:

md5       407 sha-1     312 sha-256   148 sha-512   189 

figures in megabytes per second, "long" message (this messages longer 8 kb). sphlib, library of hash function implementations in c (and java). implementations same author (me) , made comparable efforts @ optimizations; speed differences can considered intrinsic functions.

as point of comparison, consider recent hard disk run @ 100 mb/s, , on usb top below 60 mb/s. though sha-256 appears "slow" here, fast enough purposes.

note openssl includes 32-bit implementation of sha-512 quite faster code (but not fast 64-bit sha-512), because openssl implementation in assembly , uses sse2 registers, cannot done in plain c. sha-512 function among 4 benefits sse2 implementation.

edit: on this page, 1 can find report on speed of many hash functions (click on "telechargez maintenant" link). report in french, full of tables , numbers, , numbers international. implemented hash functions not include sha-3 candidates (except shabal) working on it.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -