Ticket generator and verifier