As a currently popular technology, the use of smart cards continues to increase in various fields and the rapid development of technology. Therefore, data security stored on a smart card needs to focus on avoiding misuse of data by unauthorized parties. However, it is not enough for the security mechanism to be carried out only during the communication process of sending data. Then, the mechanism for securing data on the smart card also needs to be done. In this study, a data security technique using dynamic keys is proposed by changing the key and access conditions on the smart card according to predetermined rules. Dynamic keys are a new mechanism proposed to authenticate smart cards using a different key on each card. This technique ensures that the keys used to access each smart card are different so that the risk of data duplication and modification threats can be minimized. In addition, this mechanism is a low-cost security privacy protection. The test results show that the data security technique using dynamic keys ensures that read and write access to the smart card can only be done if the keys match the rules.