jwhitbeck / otpn900

One-time password generator for the Nokia N900. Supports OAUTH tokens (HOTP, TOTP) as well as the Mobile-OTP algorithm.
GNU General Public License v3.0
4 stars 5 forks source link

Google 2-step Authentication Support #1

Open medicalwei opened 12 years ago

medicalwei commented 12 years ago

I am now using this app as a OTP for Google account.

It is actually an HOTP time-based token showing 6-digit numbers, and its key is BASE32'd.

If it is implemented, those who use Google account with N900 will be happy :)

jwhitbeck commented 12 years ago

Hi Yao,

Thanks for your feedback. I wasn't aware that google supported OTPs. Hopefully that will help to make them more mainstream.

In the meantime, have you tried converting the base32 google account key to a hex key? Unlike MOTP, the HOTP algorithm uses the binary representation of the key, so it doesn't really matter in what base you type it in as long as the otp generating program knows how to convert it to binary.

Let me know how it works. Cheers, John

On 11/18/2011 04:38 AM, Yao Wei wrote:

I am now using this app as a OTP for Google account.

It is actually an HOTP time-based token, and its key is BASE32'd.

If it is implemented, those who use Google account with N900 will be happy :)


Reply to this email directly or view it on GitHub: https://github.com/neush/otpn900/issues/1

medicalwei commented 12 years ago

I can reproduce my use of Google 2-step Authentication using otpn900 below:

  1. Start registering OTP setup on Google. Clicking “Can't scan the barcode?” shows the base32 code:

    The image showing where is the base32

  2. Convert the base32 into hexadecimal. The image showing how I did the conversion
  3. Kick up OTP on N900, and set up Google OTP as:
    • Algorithm — HOTP
    • Counter type — time-based
    • Key — The hexadecimal code.
  4. Set up the Google OTP token in the OTP generator screen:

    • Uncheck “Display Hexadecimal”
    • Digits — 6
    • Interval — 30 seconds

    The image showing how OTP should be set up

  5. Generate the code, type the code into verification area, and ta-da! The verification passes. The image showing the verification passes
jwhitbeck commented 12 years ago

Great news! thanks for the screenshots.

If you don't mind, I'll update the README for google users (minus the screenshots of your secret key of course) based on your 5 steps.

When I have a little more time, I'll update the code to allow using base32 keys directly.

Cheers, John

On 11/18/2011 11:00 AM, Yao Wei wrote:

I can reproduce my use of Google 2-step Authentication using otpn900 below:

  1. Start registering OTP setup on Google. Clicking “Can't scan the barcode?” shows the base32 code:

    The image showing where is the base32

  2. Convert the base32 into hexadecimal. The image showing how I did the conversion
  3. Kick up OTP on N900, and set up Google OTP as:
    • Algorithm — HOTP
    • Counter type — time-based
    • Key — The hexadecimal code.
  4. Set up the Google OTP token in the OTP generator screen:

    • Uncheck “Display Hexadecimal”
    • Digits — 6
    • Interval — 30 seconds

    The image showing how OTP should be set up

  5. Generate the code, type the code into verification area, and ta-da! The verification passes. The image showing the verification passes

Reply to this email directly or view it on GitHub: https://github.com/neush/otpn900/issues/1#issuecomment-2787528

medicalwei commented 12 years ago

Don't worry, this secret key won't work on my account. I replaced with another one already. :)

ashneo76 commented 12 years ago

What program did you use to convert from base32 to hex?

medicalwei commented 12 years ago

Terribly, I was trying to get a JavaScript web program to do so. I forgot which one I use.

ashneo76 commented 12 years ago

Thanks. Your image helped. Found it at: http://www.darkfader.net/toolbox/convert/

sicelo commented 6 years ago

on debian, installing the basez package allows you to do something like echo "YOUR_CODE_HERE" | base32plain -d | hex -c

baptx commented 5 years ago

@sicelo thanks, echo "YOUR_CODE_HERE" | base32plain -d | hex -c worked for me! It is safer to use offline tools than pasting a private key on a third-party website. It looks like the screenshots of @medicalwei are not working anymore (404 Not Found error). Note: I had to add 6 times the = character at the end of the code to avoid the error "base32plain: invalid input".