One Time PasswordThe One Time Password protocol has an initial seed, and then a function is applied for each interation. For example the first time we have f(M), the next time f(f(M)), and then f(f(f(M)), and so on. The only way that it is possible to determine the next password is to know the first password. I have used a simple function which does a bitshift and an exclusive-OR operation: |
Theory
Code
public string genotp(String s) { uint val = Convert.ToUInt32(s); val = RotateRight(val, 5) ^ 43; String.Format("{0:00000000}", val); return (val.ToString()); }