Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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

share|improve this answer

Yes, HOTP can include a PIN/Password also.

If you check RFC 4226, it says

Composite Shared Secrets

It may be desirable to include additional authentication factors in the shared secret K. These additional factors can consist of any data known at the token but not easily obtained by others.
Examples of such data include:

  • PIN or Password obtained as user input at the token
  • Phone number
  • Any unique identifier programmatically available at the token

etc.

And the HOTP Extensions document, also has a reference to this

4.6 PIN/Password "salted" HOTP Response

In this case, the PIN/password value used to control the usage of the token and/or protect access to the key embedded in the hardware (or software) token can be injected in the Response computation, as well as the random question Q:

Response = HOTP (K, Q|P)

Where | stands for concatenation.

etc.

You can check both documents for more info.

share|improve this answer
    
Cheers for the links. I tried both of the scheme of concatenating the key and the counter with a hash of the pin but that doesn't seem to match the output. To give you the data I have Key: MHQ34-F4XKC-NEHAU-JY2MG Pin: 1234 First Password: 372189 –  Dean Reilly Jul 12 '13 at 14:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.