Calculator Community > TI 68K

Authenticator App

(1/2) > >>

1cook:
This is a Ti 89 program that provides 2-Factor authentication codes. It is compatible with google-authenticator.

How to get:
Download the binary (89z) on this page: https://github.com/1cook/ti89_authenticator/releases
This single binary works on the Ti-89 Titanium and the Voyage 200.

Follow the instructions in README.md: https://github.com/1cook/ti89_authenticator

Some parts of the code taken from outside sources:
Time conversion: http://howardhinnant.github.io/date_algorithms.html
SHA1: https://github.com/clibs/sha1
Base32: https://github.com/calzakk/CyoEncode

Eeems:
Are you planning to publish on ticalc?

Deep Toaster:
Ohhh, that's a really clever use of a calculator (unfortunately not a model I have). I'd love to pull out my TI-84 for 2fa; maybe that'll be a fun project for me :)

How large does the binary come out to be?

EDIT: I see the 18 KB release now.

1cook:

--- Quote from: Deep Toaster on February 24, 2021, 02:32:18 pm ---Ohhh, that's a really clever use of a calculator (unfortunately not a model I have). I'd love to pull out my TI-84 for 2fa; maybe that'll be a fun project for me :)

How large does the binary come out to be?

EDIT: I see the 18 KB release now.

--- End quote ---

I'm not very familiar with programming on the z80 calculators, but I can say some things about this.
You would need to be able to do these on the calculator:
- Take the SHA1 hash for binary data as large as 64 bytes.
- Get the current time
- Read in secret keys from user input
- Store small secret keys in RAM or flash (likely as a variable)
- Display codes on the screen

I imagine that that first one will be the most difficult. You would need to use assembly language (I don't think that there is a C compiler for the Ti84 Plus, and basic is far too slow, although there is a C compiler for the color calculators). I also can't find any implementations of SHA1 in z80 assembly, so you may have to make one on your own.

From what I can remember, the Ti84 has a built in clock, the Ti83 does not. You would need to figure out if there is a particular ROM call that you can use to get the time. If not, maybe it is stored at some memory address.

If after considering all of this, you are still confident that you can write this, then you should read these specifications so you know exactly what it is that you are implementing:
- RFC 2104 HMAC: Keyed-Hashing for Message Authentication
- RFC 4226 HOTP: An HMAC-Based One-Time Password Algorithm
- RFC 6228 TOTP: Time-Based One-Time Password Algorithm
- RFC 4648 The Base16, Base32, and Base64 Data Encodings (Base32 is used to convert user input into binary secret keys)
You could also read the code that I have written, or that of some smartphone authenticator app.

Xeda112358:
@ACagliano just implemented sha1 and sha256 for the eZ80 calcs, so maybe Cags would be interested :P

As for the time, on the 84+ you can just read a byte from each port 0x41-0x44

Navigation

[0] Message Index

[#] Next page

Go to full version