How does SafeNet MobilePASS generate passwords? We use MobilePASS at work but the latest version of the android client seems to be buggy so I wanted to have a go at implementing the algorithm myself.

You can download the client to play with here: http://www.safenet-inc.com/support-downloads/mobilepass-download-page/

It looks to be based on the HMAC-SHA256 OTP algorithm. The client provides the user with the secret key when creating a new token which is copied into a web interface server side.

The bit I'm unsure about though is the pin. It looks like this is also included in the process but I'm having trouble determining exactly how.

Is there a standard way of extending HOTP to include a pin?
So I was finally able to work this out. The pin code isn't important and is simply used to decrypt the activation code locally (not sure why our server asks for it in that case).

The activation code is a base32 encoding of a seed where every fifth character acts as a checksum for the previous four.

The seed is then passed through KDF1 to generate the shared secret.

That is then in turn used as part of the HOTP algorithm.

You can see my reimplementation in python here: https://github.com/datr/MobilePASSER/blob/python/mobilepass.py