Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I ran openssl speed on my Ubuntu computer. Some results:

Doing md4 for 3s on 16 size blocks: 9063888 md4's in 3.00s
Doing md4 for 3s on 64 size blocks: 7105157 md4's in 3.00s
Doing md4 for 3s on 256 size blocks: 4507884 md4's in 3.00s
Doing md4 for 3s on 1024 size blocks: 1809773 md4's in 2.99s
Doing md4 for 3s on 8192 size blocks: 275679 md4's in 3.00s

What exactly those numbers mean?

  1. what is 'Doing md4 for 3s' mean? does it mean do the whole test for 3 times/seconds?
  2. what does '1809773 md4's in 2.99s' mean?
  3. what does '8192 size blocks' mean?
share|improve this question

2 Answers 2

up vote 5 down vote accepted

MD4 is a hash function; it processes input messages which are sequences of bits of arbitrary length. Processing time is roughly proportional to the input length, but with starting and finishing a hash function invocation imply some fixed overhead, partly due to the algorithm (initialization, padding...), partly to the idiosyncrasies of CPU (caches, branch prediction...).

Your first line says that OpenSSL computed a complete hash over a 16-byte messages, and did it again, and again... up to a grand total of 9063888 times within a time frame of 3.0 seconds. This implies a hashing bandwidth of about 48.34 MB/s (that's 16 times 9063888, divided by 3.0). The last line, on the other hand, says what happens when OpenSSL hashes (repeatedly) 8192-byte messages: it can do so 275679 times in 3.0 seconds, for a total hash bandwidth of 752.8 MB/s, more than 15 times more. This illustrates that the overhead of starting / finishing the hash function invocation dominates computation cost when dealing with small messages. The last line is, on the other hand, close to the bandwidth which can be achieved when processing a very long input.

Note that benchmarks mostly measure themselves. If you were to actually hash a lot of input bytes, e.g. one or two very big files, you would have to take into account the time needed to move the data around, in particular reading it from disk or network. The OpenSSL benchmark, by construction, plays entirely within the CPU L1 cache, making it often unrealistic.

share|improve this answer
  1. It ran md4 as many times as it could for 3 seconds
  2. This is how many times it managed to complete in 3 seconds
  3. This is the size of blocks used. You can see how much longer a block of 8192 takes than a block of 16
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.