# 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:

1. Generate hash outputs that will never "collide" provide the inputs to such hash function never collide.
2. 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 &= \text{HMAC-SHA-1}(K_1, i_0) \\ B &= \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?

-

## migrated from cs.stackexchange.comFeb 17 '14 at 18:19

This question came from our site for students, researchers and practitioners of computer science.

@Basie: Welcome to Crypto.SE! Make sure to register your account over here to take back ownership of your question :) – figlesquidge Feb 17 '14 at 18:32