Sun 13 Aug 2006
News on my favorite low priority, by the way project: a pure Scheme implementation of the MySQL protocol. Login for user accounts without passwords seems to work fine. The next thing is to implement the MySQL password algorithm. This involves the SHA1 cryptographic hash functions. There are plenty of implementations in C which I could have used via FFI bindings. However, I didn’t like the idea of an “impure” part in the protocol implementation. Especially not, if the impure part only does some integer arithmetic.
So, I wrote an SHA1 implementation in Scheme. This was a quite nice experience, SHA1 deals with 512 bit message blocks which can easily represented as a bignum in Scheme. The code for chopping the input message into 512 bit blocks is still not complete (preprocessing the message is actually an annoying task), but once this works I hope I can login into MySQL with a password.
Technorati Tags: Scheme, MySQL, SHA1