News for hackers. Stuff that matters.
Re:Tiny Toy TOTP Generator in 18 Lines of Python by PeterisP on Sunday August 11, 2019 @11:58AM (#20668695)
Well, the key part essentially is just like that, it's the single line

     mac = hmac.new(secret_bytes, counter_bytes, digest).digest()
and everything else is just converting data to/from the proper format for this function.
Re:Tiny Toy TOTP Generator in 18 Lines of Python by anamexis on Sunday August 11, 2019 @01:45PM (#20669354)
Well sure, but given that TOTP is itself just formatted HMAC, that "everything else" of formatting is the essence of TOTP.

Otherwise you probably wouldn't say you're implementing TOTP, you'd say you're implementing HMAC.