MD5 in Java
I wrote an implementation of the MD5 hash routine in Java originally in 1995. You'll find that implementation here. Note however that since 1995 a lot of progress has occured in the Java language and its associated libraries, as well as cryptographic hash function security. If you are planning to use a cryptographic hash function in a security-critical (during the whole required secure lifetime of the use of the hash results), do not use MD5, instead use SHA1.
That is not however to say you can not use MD5. Just do not use it anymore in new security-critical systems. Otherwise, just go ahead. Besides, who am I to tell you what to do?
UsageThe md5.jar file is a library. You need to add it to the classpath either through environmental variable CLASSPATH or using java runtime flag -classpath - or some other mechanism. For example, try: java -classpath md5.jar \ fi.iki.santtu.md5.MD5TestSuite to run the test-suite from within the archive file. Class HierarchyOriginally the class was just in no package space. When looking around at the home page rework how people have used the class I found that someone had plonked it in fi.iki.santtu.md5 package. Well, why not! That is a good, persistent package name. So the classes are in fi.iki.santtu.md5. The fi.iki.santtu.md5 package contains the following classes:
HistoryOriginally I wrote the MD5 class in 1995 for a Java applet, related to the MERCUS project in Helsinki University of Technology, Computing Science department. I put the source code and class files available on a website under the LGPL license. And then forgot about it. It seems however that quite a few people have found the class useful. Useful enough to send me bug reports and optimizations! When I reworked my web pages in 2003 I finally got the impetus to integrate these contributions as well as update the sources and class files to a bit more recent Java version (J2SE 1.4.1). If you for some peculiar reason do need old (1995) versions, I've put them also available for download. | Version HistoryVersion 1.9: Interim release. Classes have been moved to
fi.iki.santtu.md5 package, an md5.jar creation
added, but various optimizations and patches provided by the Java
community are pending integration (e.g. for 2.0 release). Version 1.0 aka before versioning: Original implementation
circa 1995-1996. I have posthumously named this honorable release as
version 1.0. The file below is the old-old release just slightly
repackaged. It does not live in any package hierarchy itself. Fact sheet
Requires: Java runtime and/or compiler
|