I have a few terminals that I currently use a static IP to authenticate. The problem is in my country the internet is not stable, so often I have to switch to mobile data, then the terminals can't authenticate because their IP addresses changes.
The solution I have thought of is using the MAC address of a terminal as a Username, and then for the password I would generate it as follows:
My concern is
CustomFooAlgorithm is basically a shared secret across all terminals. Also I am not sure how to create such an algoirthm that would not be easy to figure out. Could this work? I like that their is no customisation per a terminal.
A more complicated way
I am guesing I would have to create an additional secret token for each terminal, and also store the secret token on the server. Then the webservice could seed some common hashing algorithm with the server token, and the secret token, to generate an OTP.
I thought one could generate the secret key from the mac address, but that is indirectly the same as doing
CustomFooAlgorithm , just splitting it into 2 steps. The advantage of two steps is then a generic algorithm can be used for step 2.
Don't Reinvent the wheel
Should I just use TOTP instead of the above? Its about the closest "off the shelve solution" I can find to solving my problem.