I am currently working on a desktop TOTP client.
From the TOTP spec at https://tools.ietf.org/html/rfc6238#section-4.1, the 6 digit OTP is generated from counter (in this case time).
But what is "time"? The spec says that the time is in the format of a Unix time epoch (seconds that have elapsed since Jan 01 1970).
My question is,
What how do I compute this Unix time?
- a) Do I get UTC time & convert it to Unix time epochs?
- b) Do I get local time & convert it to Unix time epochs?
- c) Converting both UTC & local time to Unix time gives the same value so it will not matter?