This is the part of 2FA/TOTP that many people don’t realize:
Your phone isn’t receiving the 6-digit code from the server.
Instead, your authenticator app acts like a specialized cryptographic calculator. 🧮🔐
It takes a shared secret key, combines it with the current time, and applies the TOTP algorithm to generate a temporary 6-digit code.
At the same time, the server independently performs the same calculation using its copy of the secret key and the same time counter.
Same secret + same time counter + same algorithm = same result.
That’s why your authenticator app can generate the correct code without receiving it from the server.
It’s a simple idea, but a brilliant application of cryptography.
You can even test this yourself: add the same TOTP secret to both Google Authenticator and Microsoft Authenticator. Even if you set them up at different times, both apps can independently generate the same 6-digit code at the same time.
And here’s another important point:
The algorithm doesn’t need to be secret.
TOTP is based on publicly known, standardized cryptographic algorithms such as HMAC. What needs to remain secret is the shared secret key.
So:
🧮 Algorithm/math: Can be publicly known.
🔑 Secret key: Must remain private. Never share it.
⏱️ Time: Isn’t secret.
🔐 Security: Comes from protecting the secret key, not from hiding the algorithm.
That’s a core principle of modern cryptography: A cryptographic system should remain secure even when the algorithm is publicly known. The secret is the key.
#2FA #TwoFactor #Security #Cybersecurity #SecretKey #Authentication #Cryptography #Math #TOTP #OTP #AuthenticatorApp #Internet #SecurityResearch
About This Hashtag
#otp
4 posts
Last used Aug 11
#otp
4 posts· Last used Aug 11
Replying to @Mae@is.badat.dev
@Mae@is.badat.dev so can I finally mandate PGP-based 2FA (like on dread)?
Cuz I won't install a garbage app that won't run on my devices anyway and I won't have TOTP / HOTP available all the time…
#PGO #2FA #App #Enshittification #OTP #TOTP #HOTP
ulimit -l
98304
sources
man ulimit (3)
man otpclient (1)
https://github.com/paolostivanin/OTPClient/wiki/Secure-Memory-Limitations
#2FA #MFA #ulimit #OTP #secure #ram #limit #programming #OpenSource
You've seen all posts