Monday, November 16, 2009

Message Digest algorithms in Java Cryptography Architecture

This is the 2nd part of Message Digest algorithms test. I did performance tests on MD5, SHA-1, SHA-256, SHA-384 and SHA-512 in Java Cryptography Architecture (JCA) of Java SE6 against the same file as in 1st part.


Alg. Name Real Time User Time System Time
MD5 0m15.004s 0m9.109s 0m1.344s
SHA-1 0m38.654s 0m35.318s 0m2.036s
SHA-256 0m59.053s 0m56.032s 0m1.784s
SHA-384 1m56.362s 1m53.663s 0m1.364s
SHA-512 1m58.385s 1m53.727s 0m1.484s

The results are quite interesting if compared with the results of md5sum, sha1sum, sha224sum, sha256sum, sha384sum and sha512sum in Ubuntu in 1st part. Basically
  • MD5 is comparable in terms of time but with a higher percentage of CPU usage (2X);
  • SHA-1 and SHA-256 are much slower (2X);
  • SHA-384 and SHA-512 are a bit faster than native implementations.

No comments:

Post a Comment