[Monetdb-developers] hashing algorithms usage in MonetDB/Five
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.
Fabian, FYI Starting the server takes 0.032 sec for M4 and 0.056 for M5 on my machine. Connection to the server using MapiClient takes 0.009 sec for M5 and using mjclient before rolling forward to hashes on M5 takes ~0.150 sec. This puts the overhead of connecting using the challenges in a different perspective. Fabian Groffen wrote:
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.
------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
On 28-04-2006 23:33:38 +0200, Martin Kersten wrote:
Fabian, FYI
Starting the server takes 0.032 sec for M4 and 0.056 for M5 on my machine.
Ok, that's separate on the hash issue, right?
Connection to the server using MapiClient takes 0.009 sec for M5 and using mjclient before rolling forward to hashes on M5 takes ~0.150 sec.
And afterwards? What is "before rolling forwards to hashes"? Currently your M5 won't be compiled with support for hashes (see other thread), so the behaviour of mjclient will be exactly the same (using a plain text password) as before implementing the hashes.
This puts the overhead of connecting using the challenges in a different perspective.
Fabian Groffen wrote:
On 28-04-2006 23:33:38 +0200, Martin Kersten wrote:
Fabian, FYI
Starting the server takes 0.032 sec for M4 and 0.056 for M5 on my machine.
Ok, that's separate on the hash issue, right? Yes, it is meant as a frame of reference. One more, starting a M5 server followed by sql initialization: 0.129 sec.
Connection to a server using MapiClient takes 0.009 sec for M5 and using mjclient before rolling forward to hashes on M5 takes ~0.150 sec.
And afterwards? What is "before rolling forwards to hashes"? Currently your M5 won't be compiled with support for hashes (see other thread), so the behaviour of mjclient will be exactly the same (using a plain text password) as before implementing the hashes.
Yes, I wait for the M5 commits in this area before doing the experiment again.
This puts the overhead of connecting using the challenges in a different perspective.
------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
On 29-04-2006 08:53:52 +0200, Martin Kersten wrote:
And afterwards? What is "before rolling forwards to hashes"? Currently your M5 won't be compiled with support for hashes (see other thread), so the behaviour of mjclient will be exactly the same (using a plain text password) as before implementing the hashes. Yes, I wait for the M5 commits in this area before doing the experiment again.
Ok, should be there now. I have some compilation issues with SQL on Darwin, so I can't see what's the startup time here for now.
participants (2)
-
Fabian Groffen
-
Martin Kersten