←back to thread

248 points dogacel | 1 comments | | HN request time: 0s | source
Show context
jqpabc123 ◴[] No.43704333[source]
I implemented TOTP as a command line app doing lookup and generation by pulling secrets from a locally encrypted password file.

And before someone asks, the decrypt key is only stored in my head and the app fails silently after a significant delay if the decrypt fails.

What I don't get is how HOTP is anything but a fail waiting to happen if used across an unreliable network. Maybe this explains why I have yet to encounter a real world deployment of HOTP.

replies(2): >>43705511 #>>43709099 #
dogacel ◴[] No.43709099[source]
Client and server can potentially agree on the counter with a handshake.
replies(1): >>43712969 #
jqpabc123 ◴[] No.43712969[source]
How does such a handshake agreement get triggered?

How does the server know that the handshake request is not malicious? 2FA that is resettable on demand (without 2FA) effectively voids the whole concept does it not?

With HOTP, the counter is the shared secret --- but a dynamic and potentially unstable one. One failed request or one missed response and the counters on client and server are no longer in sync. Hence, a failure waiting to happen on an unreliable network.

replies(1): >>43724106 #
dogacel ◴[] No.43724106[source]
Why counter is the shared secret? In TOTP time is the counter and it is obviously not secret, so there is no reason to think the counter would be secret as well. Clients can sync their counter to match the server.
replies(1): >>43727563 #
jqpabc123 ◴[] No.43727563{3}[source]
In TOTP, time exists independent of both client and server and as you point out, is no secret to either.

In HOTP, the secret counter is not independent and must remain synchronized between client and server.

A counter that can be synchronized on demand is kinda superfluous --- not really secret and not terribly relevant either. All else being equal, an attacker can sync up just as easily as a legitimate client so why bother with the counter?

I expect HOTP exists somewhere out there in the real world but I have yet to encounter it. Every 2FA I have actual experience with has been TOTP.

replies(1): >>43731529 #
1. dogacel ◴[] No.43731529{4}[source]
> A counter that can be synchronized on demand is kinda superfluous --- not really secret and not terribly relevant either. All else being equal, an attacker can sync up just as easily as a legitimate client so why bother with the counter?

A unique counter for each authorization attempt ensures the resulting key is different for each attempt, which makes replay attacks not possible. I agree if you sync the counter two ways, it is better to use a "nonce", a totally random secret each time.