/fauth

Rolling key sequence generator. Much as open authenticator

Primary LanguageJavaMIT LicenseMIT

fauth


Introduction • Getting started • Troubleshooting

📚 Introduction

fauth is a rolling keys generator which is commonly used for 2-factor authentication these days. The number sequences depend on a seed. The length of the sequence can also be specified.

Motivation

I could lie and tell yout that this project has much use, but there are already far better and secure authenticators using secure algorithms. However, writing it yourself will enhance your understanding of the functionality. Moreover, you have all the control you want.

Should you use it? Absolutely not!

📖 Getting started

There is really not much to know about fauth. This project consists of only one class called Authenticator

Authenticator authenticator = new Authenticator(
    System.currentTimeMillis(), // seed
    6                           // digits
);

After instantiating the authenticator, you have to call only one method called generate

authenticator.generate(index); // index > 0

You can specify which sequence should be calculated. However, keep in mind that index should be bigger that 0 and thus positiv. This index should be calculated by the elippsed time since creation in order to have a rolling key algorithm.