An Anti-Counterfeit Mechanism for the Application Layer in Low-Cost RFID Devices