Im making calculating device that displays the 6 digit one time password for my online accounts. I got everything i think i need. but im having trouble searching on how to calculate the 6 digit?
I have the secret key its alphanumeric and im not sure how to turn this into 6 numeric digits
One approach is to choose an arbitrary 6 digit number to represent the password.
im not quite sure what you mean? i dont think there is another way of doing this, i have to calculate those 6 digit, I just dont know how to
First you need to know which protocol is being used. Hopefully it is one of the open standards.
Initiative for Open Authentication (OATH) is an industry-wide collaboration to develop an open reference architecture using open standards to promote the adoption of strong authentication. It has close to thirty coordinating and contributing members and is proposing standards for a variety of authentication technologies, with the aim of lowering costs and simplifying their functions.
The name OATH is an acronym from the phrase "open authentication", and is pronounced as the English word "oath".
...
[edit]
This one in particular:
Time-based one-time password (TOTP) is a computer algorithm that generates a one-time password (OTP) that uses the current time as a source of uniqueness. As an extension of the HMAC-based one-time password algorithm (HOTP), it has been adopted as Internet Engineering Task Force (IETF) standard .mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-par...
Calculate? Do try to say: Create? Use the random function in the IDE, bang and/or twist it, and make characters...?
on the data that was given to me; it says type: TOTP. and the wiki link you sent has a see also about TOTP algorithm. is say there:
TOTP uses the HOTP algorithm, replacing the counter with a non-decreasing value based on the current time:
TOTP value(K ) = HOTP value (K , CT ),
calculating counter value
but i dont see where the secret key would be used? isnt that weird?
That would be the HOTP part of the protocol.
HMAC-based one-time password (HOTP) is a one-time password (OTP) algorithm based on HMAC. It is a cornerstone of the Initiative for Open Authentication (OATH).
HOTP was published as an informational IETF RFC 4226 in December 2005, documenting the algorithm along with a Java implementation. Since then, the algorithm has been adopted by many companies worldwide (see below). The HOTP algorithm is a freely available open standard.
The HOTP algorithm provides a method of authentication by symmetric ...
You may want to try to get this working using a toolkit on your computer first before spending time trying to implement this on an Arduino.
Also, a quick search for TOTP Arduino gives some interesting results.
Thanks i think this is a good starting point, this seem to be more complicated than i thought.
My current goal is to basically create this function
unsigned int calculateOTP (String secretkey, unsigned long currentTime)
drakejest:
TOTP value(K) = HOTP value(K, CT)
but i dont see where the secret key would be used?
I think the Secret Key is 'K'.
system
Closed
June 27, 2023, 2:55pm
10
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.