A method and system are described for protecting a manufactured item from counterfeiting. The manufactured item, which is marked with an identifier, such as a serial number, is associated with a code generator that has secret functions and data for generating verification codes. The manufactured item is then supplied along with the corresponding code generator. Thereafter, the identifier from the manufactured item and the verification code generated by the code generator are used to verify authenticity of the manufactured item.