A method performed by a device for generating a virtual code for authentication, comprising:
- transmitting, time data to a card upon tagging of the card in which an IC chip has been embedded;
- receiving, from the card, a first virtual code generated based on the time data;
- generating, a second virtual code for authentication by using the first virtual code;
- transmitting, the second virtual code to a server;
- and
- requesting, the server to perform verification on the second virtual code,
- wherein the first virtual code is generated by using the time data, a first OTP and a first UID, which is identification information of the card, and
- wherein the second virtual code is generated by using data including the first virtual code and a second UID, which is identification information of the device.