pebbleOTP
Time based One Time Password generator for pebble
- RFC6238 OTP (Google Authenticator)
- Battle.net OTP
- Get your OTP Secrets
- Secrets for Google Authenticator is already base32 encoded. just use it as
- Battle.net OTP Secret can be obtained by using python-bna(https://github.com/Adys/python-bna)
- python-bna saves secret in "~/.config/bna/bna.conf". this secret is hexlified. you should unhexlify and base32 encode it.
import base64, binascii
print base64.b32encode(binascii.unhexlify('YOUR_BATTLE_NET_SECRET'))
- edit
src/main.c
to input the your OTP info
- edit
OTP_INFO
.type
can betotpGoogle
ortotpBattlenet
secret
is your base32 encoded secret.description
is description.- You want to add more OTP, just expand OTP_INFO variable. here is an example.
OTPInfo OTP_INFO[] = {
{
.type = totpGoogle,
.secret = "secretsecret",
.description = "Github"
},
{
.type = totpBattlenet,
.secret = "battlenetotpsecret",
.description = "Battle.net OTP!"
},
};
- edit
src/totp.c
to setup default timezone
- variable
TIMEZONE
is an index forTIMEZONE_MAP
. find your timezone offset from UTC inTIMEZONE_MAP
and setTIMEZONE
to your timezone index.
- Just build it and install on your pebble.