Implementing a MongoDB protocol

Inspired by this question ( soon to be closed or shunted off to obscurity )

I wondered how hard really would it to do this?

Of course, there are counter arguments why it's a complete waste of time

Anyway, as I mentioned in the above SO answer, it's a simple wire protocol that uses a request/response so it should be straight forward enough to implement. Data is encapsulated using a BSON format which is a binary JSON format. We don't yet have a BSON parser but @rebolek had one in 2013 and is working now to finish and release it.

So, this stub is here for someone who wants to work on it.

MLabs who provide a 500Mb MongoDB for use as a sandpit are using SCRAM-SHA1 authentication method which is like a modern CRAM-MD5 where the password is securely hashed by both client and server and the hashed versions are then compared. So, this needs to be written first.

The cryptographic algorithms you'll need are SHA-1, HMAC with SHA-1 and PBKDF2 with SHA-1.