How do programs with 2fa enabled keep track of the 2fa code, since it changes in a short time span and there’s many different ways / apps to generate said code?

986 views

How do programs with 2fa enabled keep track of the 2fa code, since it changes in a short time span and there’s many different ways / apps to generate said code?

In: Technology

6 Answers

Anonymous 0 Comments

All computers and devices use the same universal time code, it doesn’t matter where you are the time is the same. This time is nothing more than counting every second that has passed since 1 January 1970 00:00:00. You can see the current time here [https://www.unixtimestamp.com/](https://www.unixtimestamp.com/).

When you set up 2FA the server shares a secret with you, this is just random characters (nHCg8Pn42MiKBE).

Both you and the server do some math with the universal time and the secret and it generates the 6 digit code. Both do this every 30 seconds.

You are viewing 1 out of 6 answers, click here to view all answers.