US-12627469-B2 - Electronic device for storing secure data and method for operating the same
Abstract
An electronic device comprises: a first processor operating in a general non-secure environment; a second processor operating in a secure environment; a first memory allocated to the general non-secure environment; a second memory allocated to the secure environment; and a third memory shared in the general non-secure environment and the secure environment, wherein the second processor is configured to: encrypt at least a portion of secure data to generate an encrypted portion, the secure data generated by a trusted application executed in the secure environment, store the encrypted portion in the third memory, and store first information used to encrypt the at least a portion of the secure data and second information generated while encrypting the at least the portion of the secure data in the second memory, and wherein the first processor is configured to, store the encrypted portion stored in the third memory in the first memory.
Inventors
- Jinha Hwang
- Inho Kim
- DONGSUN LEE
- Jaemin Ryu
- Kyungim Jung
Assignees
- SAMSUNG ELECTRONICS CO., LTD.
Dates
- Publication Date
- 20260512
- Application Date
- 20231127
- Priority Date
- 20221125
Claims (18)
- 1 . An electronic device comprising: a first processor operating in a general non-secure environment; a second processor operating in a secure environment; a first memory allocated to the general non-secure environment; a second memory allocated to the secure environment; and a third memory shared in the general non-secure environment and the secure environment, wherein the second processor is configured to: encrypt at least a portion of secure data to generate an encrypted portion, the secure data generated by a trusted application executed in the secure environment, store the encrypted portion in the third memory, and store first information used to encrypt the at least the portion of the secure data and second information generated while encrypting the at least the portion of the secure data in the second memory, and request the secure data to the first processor as the trusted application is executed in the secure environment, and wherein the first processor is configured to, store, in the first memory, the encrypted portion stored in the third memory, based on the request from the second processor, copy the encrypted portion in the first memory as a copied portion and store the copied portion in the third memory, and wherein the second processor is configured to decrypt the copied portion in the third memory using the first information and the second information.
- 2 . The electronic device of claim 1 , wherein the second processor is configured to: encrypt the at least the portion of the secure data on a per-block basis using a different anti-replay counter (ARC) value for each block; encrypt an ARC table storing the ARC value for each block; and encrypt a tag table storing tag values generated while encrypting the at least the portion of the secure data on the per-block basis.
- 3 . The electronic device of claim 2 , wherein the first processor is configured to store the encrypted at least the portion of the secure data, the encrypted ARC table, and the encrypted tag table in a file form in the first memory.
- 4 . The electronic device of claim 2 , wherein the first information is a master ARC, and the second information is a master tag.
- 5 . The electronic device of claim 1 , wherein the encrypted portion stored in the third memory includes (i) an encrypted ARC table storing anti-replay counter (ARC) values used while encrypting the at least the portion of the secure data on a per-block basis and (ii) an encrypted tag table storing tag values generated while encrypting the at least the portion of the secure data on the per-block basis, and wherein the second processor is configured to: decrypt the encrypted ARC table using the first information and the second information, decrypt the encrypted tag table, and decrypt the encrypted portion using the decrypted ARC table and the decrypted tag table.
- 6 . The electronic device of claim 1 , wherein the first processor is configured to read a file including the encrypted portion, the encrypted ARC table, and the encrypted tag table from the first memory, store the encrypted portion, the encrypted ARC table, and the encrypted tag table separately in the third memory.
- 7 . The electronic device of claim 2 , wherein the second processor is configured to encrypt the at least the portion of the secure data and the ARC table in an advanced encryption standard (AES)-galois/counter mode (GCM) scheme.
- 8 . The electronic device of claim 1 , wherein the second processor is configured to decrypt the encrypted portion in an advanced encryption standard (AES)-galois/counter mode (GCM) scheme.
- 9 . The electronic device of claim 2 , wherein the second processor is configured to encrypt the tag table in an advanced encryption standard (AES)-electronic code block (ECB) scheme.
- 10 . A method for operating an electronic device, the method comprising: executing a trusted application in a secure environment and generating secure data by a first processor operating in the secure environment; encrypting, by the first processor, at least a portion of the generated secure data to generate an encrypted portion and storing the encrypted portion in a first memory shared in the secure environment and a general non-secure environment; storing, by the first processor, first information used to encrypt the at least the portion of the secure data and second information generated while encrypting the at least the portion of the secure data in a second memory allocated to the secure environment; storing, by a second processor operating in the general non-secure environment, the encrypted portion stored in the first memory in a third memory allocated to the general non-secure environment; requesting, by the second processor, the secure data to the first processor as the trusted application is executed in the secure environment; based on the request from the second processor, copying, by the first processor, the encrypted portion in the first memory as a copied portion and store the copied portion in the third memory; and decrypting, by the second processor, the copied portion in the third memory using the first information and the second information.
- 11 . The method of claim 10 , wherein the encrypting by the first processor includes: encrypting the at least the portion of the secure data on a per-block basis using a different anti-replay counter (ARC) value for each block; encrypting a tag table storing tag values generated while encrypting the at least the portion of the secure data on the per-block basis; and encrypting an ARC table storing the ARC value for each block.
- 12 . The method of claim 11 , wherein the storing by the second processor in the third memory includes, storing the encrypted portion, the encrypted ARC table, and the encrypted tag table in a file form in the first memory.
- 13 . The method of claim 11 , wherein the first information is a master ARC, and the second information is a master tag.
- 14 . The method of claim 10 , wherein the encrypted portion stored in the first memory includes (i) an encrypted ARC table storing anti-replay counter (ARC) values used while encrypting the at least the portion of the secure data on a per-block basis and (ii) an encrypted tag table storing tag values generated while encrypting the at least the portion of the secure data on the per-block basis, and wherein the decrypting by the first processor includes: decrypting the encrypted ARC table using the first information and the second information; decrypting the tag table; and decrypting the encrypted portion using the decrypted ARC table and the decrypted tag table.
- 15 . The method of claim 10 , further comprising, reading, by the second processor, a file including the encrypted portion, the encrypted ARC table, and the encrypted tag table from the third memory, storing the encrypted portion, the encrypted ARC table, and the encrypted tag table separately in the first memory.
- 16 . The method of claim 11 , wherein the encrypting encrypts the at least the portion of the secure data and the ARC table in an advanced encryption standard (AES)-galois/counter mode (GCM) scheme.
- 17 . The method of claim 10 , wherein the decrypting decrypts the encrypted portion in an advanced encryption standard (AES)-galois/counter mode (GCM) scheme.
- 18 . The method of claim 11 , wherein the encrypting the tag table encrypts the tag table in an advanced encryption standard (AES)-electronic code block (ECB) scheme.
Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation application of International Application No. PCT/KR2023/018740, filed on Nov. 21, 2023, which claims priority to Korean Patent Application No. 10-2022-0160173, filed on Nov. 25, 2022, in the Korean Intellectual Property Office, the disclosures of which are incorporated by reference herein their entireties. BACKGROUND 1. Field The disclosure relates to an electronic device for storing secure data and a method for operating the same. 2. Description of Related Art In a wireless communication system, an electronic device (e.g., user equipment (UE)) may access a wireless communication network and use a voice communication service or a data communication service in a fixed position or on the move. More and more services and additional functions as well as voice communication services or data communication services are being provided through electronic devices. To provide various services and additional functions to an electronic device, an appropriate authentication process is required, and data requiring security needs to be safely processed. In general, a universal integrated circuit card (UICC) is inserted into the electronic device, and authentication is performed between the electronic device and the server of the mobile network operator (MNO) through a universal subscriber identity module (USIM) installed in the UICC. If the user of the electronic device subscribes to a wireless communication service provided by the MNO, the MNO may provide a UICC (e.g., a SIM card or a USIM card) to the user. The user may insert the provided UICC into his or her electronic device. Recently, there has been proposed new type of UICC referred to as an embedded UICC (eUICC) configured to remotely install a profile for providing a communication service through a network without replacing the UICC even when the user changes a communication carrier. The eUICC may be manufactured as a pre-mounted UICC chip fixed in the terminal during the terminal manufacturing process. An integrated SIM (iSIM), which is more advanced than the eUICC, has been proposed in which the SIM function is integrated into the hardware of the electronic device and configured in the form of a system on chip (SOC). The iSIM may be used in various electronic devices that may have a structure in which physical attachment/detachment of the UICC is not easy, such as machine-to-machine (M2M) or device-to-device (D2D) terminals and Internet-of-things (IOT) devices as well as regular wireless terminals such as mobile phones. SUMMARY According to one or more embodiments, an electronic device comprises: a first processor operating in a general non-secure environment: a second processor operating in a secure environment; a first memory allocated to the general non-secure environment; a second memory allocated to the secure environment; and a third memory shared in the general non-secure environment and the secure environment, wherein the second processor is configured to: encrypt at least a portion of secure data to generate an encrypted portion, the secure data generated by a trusted application executed in the secure environment, store the encrypted portion in the third memory, and store first information used to encrypt the at least a portion of the secure data and second information generated while encrypting the at least the portion of the secure data in the second memory, and wherein the first processor is configured to, store the encrypted portion stored in the third memory in the first memory. According to one or more embodiments, a method for operating an electronic device, the method comprising: executing a trusted application in a secure environment and generating secure data by a first processor operating in the secure environment: encrypting, by the first processor, at least a portion of the generated secure data to generate an encrypted portion and storing the encrypted portion in a first memory shared in the secure environment and a general non-secure environment: storing, by the first processor, first information used to encrypt the at least the portion of the secure data and second information generated while encrypting the at least the portion of the secure data in a second memory allocated to the secure environment: and storing, by a second processor operating in the general non-secure environment, the encrypted portion stored in the first memory in a third memory allocated to the general non-secure environment. According to one or more embodiments, a non-transitory computer readable medium having instructions stored therein which when executed by at least one processor in an electronic device cause the at least one processor to execute a method for operating an electronic device, the method comprising: executing a trusted application in a secure environment and generating secure data: encrypting at least a portion of the generated secure data to generate an encrypted portion a