Finite-State Machine for Single-Use Code Authentication