[Monetdb-developers] hashing algorithms usage in MonetDB/Five

Fabian Groffen Fabian.Groffen at cwi.nl
Fri Apr 28 23:07:53 CEST 2006

Hi all, FYI

Sourceforge isn't really cooperating, but I implemented MD5 and SHA1
hash algorithms support during challenge response in MAPI.  I extended
the JDBC driver to be able to use SHA1 or MD5 next to plain (crypt is
not easily available in Java).  I will check in my changes as soon as
1) SourceForge lets me, and
2) My physical state + location lets me

I also added a little option to JdbcClient to force usage of a specified
hash algorithm, using -Xhash.  I conducted a little experiment to see
the effect of connecting with a hash or plain.  The results for my system is as follows:  (I ran every call 10 times and took the average)

% time java -jar jars/jdbcclient-1.4.jar -Xhash SHA1 < /dev/null
real 0.29
% time java -jar jars/jdbcclient-1.4.jar -Xhash MD5 < /dev/null
real 0.29
% time java -jar jars/jdbcclient-1.4.jar -Xhash plain < /dev/null
real 0.23

The precision of time is seconds here, so the difference in time (or the
cost of both hash implementations) is 0.06 seconds.  This includes the
time for the server to do the same of course.  All in all, not really
shocking IMHO.  Please note that the JdbcClient does a lot of other
stuff like querying the database for its version number and such.  When
not doing that the time will be probably lower.  Also, the wallclock
time does also include the full JVM startup.  The C implementation of
the hashes might be more efficient, I can only tell something useful
about that once MapiClient will also support hash algorithms.

More information about the developers-list mailing list