OTP sequence uniqueness Is it possible to use Time-based One Time Password (TOTP) algorithms to generate tokens from multiple channels (where a channel is defined as a "user" using a certain shared key $K_c$ for channel $c$), and in so doing identify the channel itself from the OTP?

My overall objectives are to:


Generate hash outputs that will never "collide" provide the inputs to such hash function never collide.
Identify from the hash output (the OTP) what the "channel" was that created it, and whether it is a valid OTP. This is trivial for a single channel generating OTP's, but you need an "authenticator" for every channel. I want one server side authenticator for multiple channels/users and be able to derive from the OTP itself what the channel/user is.




My current approach:

Suppose two OTP's were generated with the same time sequence constant $i_0$, and shared secret keys $K_1$ and $K_2$ respectively. Let $A$ and $B$ be the OTP's:
$$\begin{align*}
  A &amp;= \text{HMAC-SHA-1}(K_1, i_0) \\
  B &amp;= \text{HMAC-SHA-1}(K_2, i_0) \\
\end{align*}$$
Would it be possible on the server side during validation to establish without the shadow of a doubt (mathematically speaking) that $A$ is "linked" to channel 1 ($K_1$), and $B$ to channel 2? In other words, every OTP generated using $K_1$ will be different to those OTP's generated using $K_2$ regardless of the truncation of the 160-bit output of HMAC. I believe this is the equivalent of enquiring as to uniqueness of the output of a hash function given unique inputs. 

If this happens, and the two "sequences" are different, can their difference be quantified in terms of say a Hamming distance?
Yes, it is possible.  You described how in your question.  I'm not sure what your remaining problem is.  You can think of this as two totally different, independent logical "users" -- or as two different OTP sequences -- with both of them assigned to the same person, using a different one for each channel.  If the OTP scheme is secure, then your approach will be secure too.

The difficult part will be the usability aspects: to convince the user to make to use the proper OTP sequence for the channel they are using.

Also, OTPs are not secure against man-in-the-middle attacks, so they are not a complete solution.



Lastly, one tip for how to get better answers here.  Try describing what you are trying to achieve (what your requirements are) and ask for how to achieve it.  You might get answers or approaches that you hadn't anticipated.