Trusted execution environment data offline migration method and device

By establishing a wireless communication link between devices, using the random password entered by the user to generate an encryption key, and through SIM card and device certificate verification, the security and cross-brand migration problems of TEE data migration are solved, and the security is achieved. Convenient data migration process.

CN114765544BActive Publication Date: 2024-11-08CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110029319.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-11
Publication Date
2024-11-08
Estimated Expiration
2041-01-11

AI Technical Summary

Technical Problem

The prior art is difficult to safely migrate data from the trusted execution environment TEE when a user replaces the device, and data migration between different brands of devices is difficult, which poses security risks and high management costs.

Method used

By establishing a wireless communication link between the first device and the second device, using the random password entered by the user to generate an encryption key, data decryption and encryption are performed, and legality verification is performed through the SIM card and the device certificate to ensure data transmission is ensured. security and authentication process.

Benefits of technology

It realizes secure data transmission without connecting to the backend server, reduces the risk of data leakage, enhances user identity verification security, and supports data migration between devices of different brands, reducing management costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114765544B_ABST
    Figure CN114765544B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for offline migration of data in a trusted execution environment, and belongs to the field of data service technology. The method for offline migration of data in a trusted execution environment is executed by a first device, and the method includes: establishing a wireless communication link with a second device, and performing a legitimacy check; decrypting the data to be transmitted to generate original data, encrypting the original data and signature data with a first password to obtain first data; using a MAC password to calculate the MAC value of the first data, and using a second password to encrypt the first data and the MAC value to obtain second data; sending the second data to a second device; wherein the first password and the second password are generated using random passwords input by a user. The technical solution of the present invention can increase the security of TEE data migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data service technology, and in particular to a method and device for offline migration of data in a trusted execution environment. Background Art

[0002] Trusted Execution Environment TEE (Trusted Execution Environment) is an operating environment that coexists with the normal application operating environment REE (Rich Execution Environment, such as Android, etc.) on the device. It is a secure area on the main processor of the mobile device. TEE has its own execution space, which provides a secure execution environment for trusted applications TA (Trusted Application), so it has a higher security level than REE. TEE mainly provides key management, cryptographic algorithms, secure storage, secure clock resources and services, as well as extended TUI (Trusted User Interface) and other functions.

[0003] like Figure 1 As shown in the figure, the software and hardware resources accessible by TEE are completely separated from REE, and REE cannot obtain user privacy data in TEE (such as secret keys, certificates, other encrypted data, etc.). Under normal circumstances, after the user changes the device, it is difficult to migrate the TEE data in the original device to the new device, which will cause great trouble to the user and is a very unfriendly user experience. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and device for offline migration of trusted execution environment data, which can increase the security of TEE data migration.

[0005] To solve the above technical problems, the embodiments of the present invention provide the following technical solutions:

[0006] On the one hand, a method for offline migration of trusted execution environment data is provided, which is performed by a first device, and the method includes:

[0007] Establishing a wireless communication link with a second device and performing a legitimacy check;

[0008] Decrypting the data to be transmitted to generate original data, and encrypting the original data and the signature data using a first password to obtain first data;

[0009] Calculate the MAC value of the first data using the MAC password, and encrypt the first data and the MAC value using the second password to obtain the second data;

[0010] sending the second data to a second device;

[0011] The first password and the second password are generated using random passwords input by the user.

[0012] In some embodiments, before establishing a wireless communication link with the second device, the method further includes:

[0013] Install the SIM card;

[0014] Receiving the random password input by the user;

[0015] Using the authentication APPLET on the SIM card to sign the random password to generate the signature data;

[0016] The first password and the second password are generated by the trusted application TA from the random password.

[0017] In some embodiments, performing the legality check includes:

[0018] Generate a first random number, and send the certificate of the first device and the first random number to the second device;

[0019] receiving a second random number, a certificate of the second device, a second session key factor, and second signature data sent by the second device;

[0020] verifying the certificate of the second device and the second signature data, and generating a first session key factor and a first signature data;

[0021] generating the second password using the first session key factor and the second session key factor;

[0022] sending the first session key factor and the first signature data to the second device;

[0023] Receive a security channel establishment confirmation result from the second device.

[0024] The embodiment of the present invention further provides a trusted execution environment data offline migration method, which is executed by a second device, and the method includes:

[0025] Establishing a wireless communication link with the first device and performing a legitimacy check;

[0026] receiving second data sent by the first device;

[0027] Decrypting the second data using the second password to obtain the first data and the MAC value;

[0028] Verify the MAC value, decrypt the first data using the first password, and obtain original data and signature data;

[0029] Verifying the signature data using a random password input by a user;

[0030] Encrypting and saving the original data using a trusted application TA key;

[0031] The first password and the second password are generated using random passwords input by the user.

[0032] In some embodiments, before establishing a wireless communication link with the first device, the method further includes:

[0033] Install the SIM card;

[0034] Receiving the random password input by the user;

[0035] The first password and the second password are generated by the trusted application TA from the random password.

[0036] In some embodiments, performing the legality check includes:

[0037] Receiving a first random number sent by a first device and a certificate of the first device;

[0038] verifying the certificate of the first device, generating a second random number, a second session key factor, and a second signature data;

[0039] sending a second random number, a certificate of the second device, a second session key factor, and a second signature data to the first device;

[0040] receiving a first session key factor and first signature data sent by a first device;

[0041] Verifying the first signature data using the certificate of the first device, and generating the second password using the first session key factor and the second session key factor after the verification is successful;

[0042] The secure channel establishment confirmation result is sent to the first device.

[0043] The embodiment of the present invention further provides a trusted execution environment data offline migration device, which is applied to a first device and includes a transceiver and a processor.

[0044] The processor is used to establish a wireless communication link with the second device and perform a legitimacy check; decrypt the data to be transmitted to generate original data, encrypt the original data and signature data using a first password to obtain first data; calculate a MAC value of the first data using a MAC password, and encrypt the first data and the MAC value using a second password to obtain second data;

[0045] The transceiver is used to send the second data to a second device;

[0046] The first password and the second password are generated using random passwords input by the user.

[0047] In some embodiments, the processor is further used to install a SIM card;

[0048] The transceiver is also used to receive the random password input by the user;

[0049] The processor is further configured to use the authentication APPLET on the SIM card to sign the random password to generate the signature data; and to generate the first password and the second password from the random password through a trusted application TA.

[0050] In some embodiments, the processor is further configured to generate a first random number, and send the certificate of the first device and the first random number to the second device;

[0051] The transceiver is further configured to receive a second random number, a certificate of the second device, a second session key factor, and second signature data sent by the second device;

[0052] The processor is further configured to verify the certificate of the second device and the second signature data, generate a first session key factor and a first signature data; and generate the second password using the first session key factor and the second session key factor;

[0053] The transceiver is also used to send the first session key factor and the first signature data to the second device; and receive a security channel establishment confirmation result from the second device.

[0054] The embodiment of the present invention further provides a trusted execution environment data offline migration device, which is applied to a second device and includes a transceiver and a processor.

[0055] The processor is used to establish a wireless communication link with the first device and perform a legitimacy check;

[0056] The transceiver is used to receive second data sent by the first device;

[0057] The processor is further configured to decrypt the second data using the second password to obtain the first data and the MAC value; verify the MAC value, decrypt the first data using the first password to obtain the original data and the signature data; verify the signature data using the random password input by the user; and encrypt and save the original data using the trusted application TA key;

[0058] The first password and the second password are generated using random passwords input by the user.

[0059] In some embodiments, the processor is further used to install a SIM card;

[0060] The transceiver is also used to receive the random password input by the user;

[0061] The processor is further configured to generate the first password and the second password from the random password through a trusted application TA.

[0062] In some embodiments, the transceiver is further configured to receive a first random number sent by the first device and a certificate of the first device;

[0063] The processor is further configured to verify the certificate of the first device, generate a second random number, a second session key factor, and second signature data;

[0064] The transceiver is also used to send the second random number, the certificate of the second device, the second session key factor and the second signature data to the first device; and receive the first session key factor and the first signature data sent by the first device;

[0065] The processor is further configured to verify the first signature data using the certificate of the first device, and generate the second password using the first session key factor and the second session key factor after the verification is successful;

[0066] The transceiver is further configured to send a security channel establishment confirmation result to the first device.

[0067] An embodiment of the present invention also provides a trusted execution environment data offline migration device, including a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor executes the program, the trusted execution environment data offline migration method as described above is implemented.

[0068] In some embodiments, a trusted execution environment data offline migration device is applied to a first device, and the processor is used to establish a wireless communication link with a second device and perform a legitimacy check; decrypt the data to be transmitted to generate original data, and encrypt the original data and signature data using a first password to obtain first data; use a MAC password to calculate a MAC value of the first data, and use a second password to encrypt the first data and the MAC value to obtain second data; send the second data to a second device; wherein the first password and the second password are generated using random passwords entered by a user.

[0069] In some embodiments, the processor is further used to receive the random password input by the user; use the authentication APPLET on the SIM card to sign the random password to generate the signature data; and generate the first password and the second password from the random password through a trusted application TA.

[0070] In some embodiments, the processor is also used to generate a first random number, send the certificate of the first device and the first random number to the second device; receive the second random number, the certificate of the second device, the second session key factor and the second signature data sent by the second device; verify the certificate of the second device and the second signature data, generate the first session key factor and the first signature data; generate the second password using the first session key factor and the second session key factor; send the first session key factor and the first signature data to the second device; and receive the security channel establishment confirmation result of the second device.

[0071] In some embodiments, a trusted execution environment data offline migration device is applied to a second device, and the processor is used to establish a wireless communication link with the first device and perform a legitimacy check; receive second data sent by the first device; decrypt the second data using a second password to obtain first data and a MAC value; verify the MAC value, decrypt the first data using a first password to obtain original data and signature data; verify the signature data using a random password entered by a user; encrypt and save the original data using a trusted application TA key; wherein the first password and the second password are generated using a random password entered by a user.

[0072] In some embodiments, the processor is further used to install a SIM card; receive the random password input by a user; and generate the first password and the second password from the random password through a trusted application TA.

[0073] In some embodiments, the processor is also used to receive a first random number sent by a first device and a certificate of the first device; verify the certificate of the first device, generate a second random number, a second session key factor, and a second signature data; send the second random number, the certificate of the second device, the second session key factor, and the second signature data to the first device; receive the first session key factor and the first signature data sent by the first device; verify the first signature data using the certificate of the first device, and generate the second password using the first session key factor and the second session key factor after the verification is passed; and send a confirmation result of establishing a secure channel to the first device.

[0074] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the above-mentioned trusted execution environment data offline migration method are implemented.

[0075] The embodiments of the present invention have the following beneficial effects:

[0076] In the above scheme, during data export and import, the first device and the second device do not need to connect to the background server, and the data is transmitted through the wireless link security channel between the two devices, reducing the risk of data leakage during transmission. In addition, in this embodiment, the legitimacy of the user identity is verified using the SIM card and the user-defined password to reduce security risks. Furthermore, in this embodiment, by exchanging device certificates and certificate verification, the authentication process between different devices is increased, making data migration between devices of different brands possible. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 It is a schematic diagram of TEE;

[0078] Figure 2 is a schematic diagram of a device according to an embodiment of the present invention;

[0079] Figure 3 A schematic diagram of a flow chart of a method for offline migration of trusted execution environment data according to an embodiment of the present invention;

[0080] Figure 4 It is a structural schematic diagram of a trusted execution environment data offline migration device on a first device side according to an embodiment of the present invention;

[0081] Figure 5 It is a structural schematic diagram of a trusted execution environment data offline migration device on the second device side according to an embodiment of the present invention;

[0082] Figure 6 Schematic diagram of the composition of a trusted execution environment data offline migration device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0083] In order to make the technical problems, technical solutions and advantages to be solved by the embodiments of the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0084] In the existing technology, there is a method of forwarding TEE data between different devices through cloud server forwarding. Specifically, there are three network elements: device 1, device 2, and management platform. Asymmetric keys are generated in devices 1 and 2, and the public keys of devices 1 and 2 are passed to the management platform before the devices leave the factory. The management platform generates a platform asymmetric key for each device, and pre-sets the platform public key in device 1 and device 2 respectively. When the TEE data in device 1 is migrated to device 2, device 1 first signs the device label with the private key of device 1 and sends it to the management platform. The management platform verifies the signature with the public key of device 1. After passing, device 1 encrypts the TEE data with platform public key 1 and sends it to the management platform. The management platform decrypts it into plain text with platform private key 1, and then encrypts the plain text with device public key 2 and sends it to device 2. Device 2 decrypts the data with device private key 2 and stores it in TEE.

[0085] The problems with existing TEE data migration are:

[0086] The two devices must be connected to the management platform, and data transfer cannot be performed if either device is offline.

[0087] In the existing solution, the device needs to generate a device key pair before it is used and transmit the public key to the platform; at the same time, the device generates a platform key pair for each device and pre-sets the public key in the corresponding mobile phone, which is relatively difficult to implement.

[0088] In addition, in the existing solution, authentication is only performed through text messages, which poses a security risk.

[0089] Furthermore, it is difficult to migrate data between devices of different brands. In the existing solution, each device needs to be registered on the management platform and generate a corresponding platform key. However, in reality, it is difficult to register and manage devices of different brands on the same management platform, which will increase management costs. If the device is not registered on the management platform, the existing solution cannot be implemented smoothly.

[0090] The embodiments of the present invention provide a method and device for offline migration of trusted execution environment data, which can increase the security of TEE data migration.

[0091] An embodiment of the present invention provides a trusted execution environment data offline migration method, which is executed by a first device, and the method includes:

[0092] Establishing a wireless communication link with a second device and performing a legitimacy check;

[0093] Decrypting the data to be transmitted to generate original data, and encrypting the original data and the signature data using a first password to obtain first data;

[0094] Calculate the MAC value of the first data using the MAC password, and encrypt the first data and the MAC value using the second password to obtain the second data;

[0095] sending the second data to a second device;

[0096] The first password and the second password are generated using random passwords input by the user.

[0097] In some embodiments, before establishing a wireless communication link with the second device, the method further includes:

[0098] Install the SIM card;

[0099] Receiving the random password input by the user;

[0100] Using the authentication APPLET on the SIM card to sign the random password to generate the signature data;

[0101] The first password and the second password are generated by the trusted application TA from the random password.

[0102] In some embodiments, performing the legality check includes:

[0103] Generate a first random number, and send the certificate of the first device and the first random number to the second device;

[0104] receiving a second random number, a certificate of the second device, a second session key factor, and second signature data sent by the second device;

[0105] verifying the certificate of the second device and the second signature data, and generating a first session key factor and a first signature data;

[0106] generating the second password using the first session key factor and the second session key factor;

[0107] sending the first session key factor and the first signature data to the second device;

[0108] Receive a security channel establishment confirmation result from the second device.

[0109] The embodiment of the present invention further provides a trusted execution environment data offline migration method, which is executed by a second device, and the method includes:

[0110] Establishing a wireless communication link with the first device and performing a legitimacy check;

[0111] receiving second data sent by the first device;

[0112] Decrypting the second data using the second password to obtain the first data and the MAC value;

[0113] Verify the MAC value, decrypt the first data using the first password, and obtain original data and signature data;

[0114] Verifying the signature data using a random password input by a user;

[0115] Encrypting and saving the original data using a trusted application TA key;

[0116] The first password and the second password are generated using random passwords input by the user.

[0117] In some embodiments, before establishing a wireless communication link with the first device, the method further includes:

[0118] Install the SIM card;

[0119] Receiving the random password input by the user;

[0120] The first password and the second password are generated by the trusted application TA from the random password.

[0121] In some embodiments, performing the legality check includes:

[0122] Receiving a first random number sent by a first device and a certificate of the first device;

[0123] verifying the certificate of the first device, generating a second random number, a second session key factor, and a second signature data;

[0124] sending a second random number, a certificate of the second device, a second session key factor, and a second signature data to the first device;

[0125] receiving a first session key factor and first signature data sent by a first device;

[0126] Verifying the first signature data using the certificate of the first device, and generating the second password using the first session key factor and the second session key factor after the verification is successful;

[0127] The secure channel establishment confirmation result is sent to the first device.

[0128] The following takes the first device as device 1 and the second device as device 2 as an example to further introduce the technical solution of the present invention:

[0129] like Figure 2 As shown, where:

[0130] Device 1: As a device for exporting data, device 1 first installs a SIM (Subscriber Identity Module) card. At the same time, the user enters a custom random password in device 1 to perform an export initialization operation. The trusted application TA derives the Enc encryption key (i.e., the first password) and the MAC key from the input password, and the authentication APPLET on the SIM card signs the random password entered by the user.

[0131] Device 2: As a device for importing data. After the user completes the initialization operation of exporting on device 1, he / she removes the SIM card and inserts it into device 2. At the same time, the user enters the same password on device 2 to perform the import initialization operation. After the initialization operation is completed, device 1 and device 2 establish a wireless communication link (such as a Bluetooth connection), exchange certificates and random numbers, verify the legitimacy of the certificates, and use the session key for data transmission using random numbers on both sides. After the secure channel is established, device 1 uses the session key (i.e., the second password) to encrypt and calculate the MAC for the data to be migrated and the signature data in the TEE, and transmits it to device 2 through the wireless communication link. Device 2 decrypts the data and verifies the MAC. The SIM card authentication APPLET verifies the signature data. After passing, the data is saved in the TEE of device 2.

[0132] TEE data migration is divided into four main steps: initialization operation, establishment of wireless link between devices, establishment of secure channel between devices, and TEE data transmission. During the initialization operation, the user enters a custom random password in the exporting device and the importing device, and TA generates a MAC key and Enc key from the random password; then the importing and exporting devices establish a wireless communication link (such as Bluetooth, etc.); after the communication link is established, the importing device and the exporting device exchange certificates and random numbers to verify the legitimacy of the devices. After passing the verification, both parties generate a session key from session key factor 1 and session key factor 2, and the secure channel is established. During TA data transmission, the security of TA's privacy data transmission is guaranteed through operations such as data encryption and decryption, MAC verification, session key encryption and decryption, and SIM card APPLET signature verification and authentication. The specific process is as follows Figure 3 As shown, the following steps are included:

[0133] Step 1, device 1 performs initialization operation as the exporter: SIM card is inserted into device 1, the user enters a custom random password, and TA generates a message authentication code MAC key and a data encryption key Enc from the random key. At the same time, the authentication APPLET on the SIM card signs the random password entered by the user to generate signature data SIG;

[0134] Step 2: Device 2 performs initialization operation as the importer: the SIM card is inserted into device 2, the user enters the same password as device 1, and TA generates a message authentication code MAC key and a data encryption key Enc from a random key;

[0135] Step 3: Establish a wireless communication link (such as a Bluetooth connection) between devices 1 and 2;

[0136] Step 4: Device 1 generates random number 1, and sends the device 1 certificate and random number 1 to device 2;

[0137] Step 5, device 2 verifies the certificate of device 1, generates random number 2, session key factor 2, and generates signature data 2;

[0138] Step 6, device 2 generates random number 2, and sends device 2 certificate, random number 2, session key factor 2 and signature data 2 to device 1;

[0139] Step 7, Device 1 verifies the Device 2 certificate, verifies Signature Data 2, generates Session Key Factor 1, and signs the data. In addition, a session key is generated from Session Key Factor 1 and Session Key Factor 2;

[0140] Step 8, device 1 sends session key factor 1 and signature data;

[0141] Step 9, device 2 verifies the signature data through the device 1 certificate, and verifies the session key generated by session key factor 1 and session key factor 2;

[0142] Step 10: Device 2 sends a secure channel establishment confirmation result to device 1;

[0143] Step 11, the TA in the device 1 decrypts the migration data to be transmitted, generates the original data, and encrypts the original data and the signature data SIG using the Enc key, calculates the encrypted data MAC value using the MAC key, and then encrypts the encrypted data and MAC using the session key for transmission;

[0144] Step 12, device 1 sends encrypted data to device 2;

[0145] Step 13, device 2 uses the session key to decrypt the data, verifies the MAC value, and uses the Enc key to decrypt the data. The authentication APPLET on the SIM card verifies the signature data SIG through the random password entered by the user, and finally uses the TA key to encrypt the transmitted original data and save it.

[0146] After the above steps 1-13, TEE data migration is completed. Among them, TEE data transfer does not need to connect to the background server; the user's identity legitimacy is verified using the SIM card authentication APPLET and the custom password signature verification, and the legitimacy between devices is verified based on the device certificate system to enhance security; in addition, the MAC key and Enc key are generated through the random password entered by the user to prevent data from being stolen by third-party hacker devices, further enhancing security.

[0147] In this embodiment, during data export and import, neither the first device nor the second device needs to connect to the background server, and the data is transmitted through the wireless link security channel between the two devices, reducing the risk of data leakage during transmission. In addition, in this embodiment, the legitimacy of the user identity is verified using a SIM card and a user-defined password to reduce security risks. Furthermore, in this embodiment, by exchanging device certificates and certificate verification, the authentication process between different devices is increased, making data migration between devices of different brands possible.

[0148] The embodiment of the present invention also provides a trusted execution environment data offline migration device, which is applied to a first device, such as Figure 4 As shown, it includes a transceiver 11 and a processor 12,

[0149] The processor 12 is used to establish a wireless communication link with the second device and perform a legitimacy check; decrypt the data to be transmitted to generate original data, encrypt the original data and the signature data using a first password to obtain first data; calculate a MAC value of the first data using a MAC password, and encrypt the first data and the MAC value using a second password to obtain second data;

[0150] The transceiver 11 is used to send the second data to the second device;

[0151] The first password and the second password are generated using random passwords input by the user.

[0152] In some embodiments, the processor 12 is further used to install a SIM card;

[0153] The transceiver 11 is also used to receive the random password input by the user;

[0154] The processor 12 is further configured to use the authentication APPLET on the SIM card to sign the random password to generate the signature data; and to generate the first password and the second password from the random password through a trusted application TA.

[0155] In some embodiments, the processor 12 is further configured to generate a first random number, and send the certificate of the first device and the first random number to the second device;

[0156] The transceiver 11 is also used to receive a second random number, a certificate of the second device, a second session key factor, and second signature data sent by the second device;

[0157] The processor 12 is further configured to verify the certificate of the second device and the second signature data, generate a first session key factor and a first signature data; and generate the second password using the first session key factor and the second session key factor;

[0158] The transceiver 11 is further configured to send the first session key factor and the first signature data to the second device; and receive a security channel establishment confirmation result from the second device.

[0159] The embodiment of the present invention also provides a trusted execution environment data offline migration device, which is applied to a second device, such as Figure 5 As shown, it includes a transceiver 21 and a processor 22,

[0160] The processor 22 is used to establish a wireless communication link with the first device and perform a legitimacy check;

[0161] The transceiver 21 is used to receive second data sent by the first device;

[0162] The processor 22 is further configured to decrypt the second data using the second password to obtain the first data and the MAC value; verify the MAC value, decrypt the first data using the first password to obtain the original data and the signature data; verify the signature data using the random password input by the user; and encrypt and save the original data using the trusted application TA key;

[0163] The first password and the second password are generated using random passwords input by the user.

[0164] In some embodiments, the processor 22 is further used to install a SIM card;

[0165] The transceiver 21 is also used to receive the random password input by the user;

[0166] The processor 22 is further configured to generate the first password and the second password from the random password through a trusted application TA.

[0167] In some embodiments, the transceiver 21 is further configured to receive a first random number sent by the first device and a certificate of the first device;

[0168] The processor 22 is further configured to verify the certificate of the first device, generate a second random number, a second session key factor, and second signature data;

[0169] The transceiver 21 is also used to send the second random number, the certificate of the second device, the second session key factor and the second signature data to the first device; and receive the first session key factor and the first signature data sent by the first device;

[0170] The processor 22 is further configured to verify the first signature data using the certificate of the first device, and generate the second password using the first session key factor and the second session key factor after the verification is successful;

[0171] The transceiver 21 is further configured to send a security channel establishment confirmation result to the first device.

[0172] The embodiment of the present invention also provides a trusted execution environment data offline migration device, such as Figure 6As shown, it includes a memory 31, a processor 32, and a computer program stored in the memory 31 and executable on the processor 32; when the processor 32 executes the program, the above-mentioned trusted execution environment data offline migration method is implemented.

[0173] In some embodiments, a trusted execution environment data offline migration device is applied to a first device, and the processor 32 is used to establish a wireless communication link with a second device and perform a legitimacy check; decrypt the data to be transmitted to generate original data, and encrypt the original data and signature data using a first password to obtain first data; use a MAC password to calculate a MAC value of the first data, and use a second password to encrypt the first data and the MAC value to obtain second data; send the second data to a second device; wherein the first password and the second password are generated using random passwords entered by a user.

[0174] In some embodiments, the processor 32 is further used to receive the random password input by the user; use the authentication APPLET on the SIM card to sign the random password to generate the signature data; and generate the first password and the second password from the random password through a trusted application TA.

[0175] In some embodiments, the processor 32 is also used to generate a first random number, send the certificate of the first device and the first random number to the second device; receive the second random number, the certificate of the second device, the second session key factor and the second signature data sent by the second device; verify the certificate of the second device and the second signature data, generate the first session key factor and the first signature data; generate the second password using the first session key factor and the second session key factor; send the first session key factor and the first signature data to the second device; and receive the security channel establishment confirmation result of the second device.

[0176] In some embodiments, the trusted execution environment data offline migration device is applied to the second device, and the processor 32 is used to establish a wireless communication link with the first device and perform a legitimacy check; receive second data sent by the first device; decrypt the second data using the second password to obtain first data and a MAC value; verify the MAC value, decrypt the first data using the first password to obtain original data and signature data; verify the signature data using a random password entered by a user; encrypt and save the original data using a trusted application TA key; wherein the first password and the second password are generated using a random password entered by a user.

[0177] In some embodiments, the processor 32 is further configured to install a SIM card; receive the random password input by a user; and generate the first password and the second password from the random password through a trusted application TA.

[0178] In some embodiments, the processor 32 is also used to receive a first random number and a certificate of the first device sent by the first device; verify the certificate of the first device, generate a second random number, a second session key factor, and a second signature data; send the second random number, the certificate of the second device, the second session key factor, and the second signature data to the first device; receive the first session key factor and the first signature data sent by the first device; verify the first signature data using the certificate of the first device, and generate the second password using the first session key factor and the second session key factor after the verification is passed; and send the security channel establishment confirmation result to the first device.

[0179] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the above-mentioned trusted execution environment data offline migration method are implemented.

[0180] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage terminal devices to be detected or any other non-transmission media that can be used to store information that can be accessed by the computer terminal device to be detected. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carriers.

[0181] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A trusted execution environment data offline migration method, It is characterized in that Executed by a first device, the method includes: Establishing a wireless communication link with a second device and performing a legitimacy check; Decrypting the data to be transmitted to generate original data, and encrypting the original data and the signature data using a first password to obtain first data; Calculate the MAC value of the first data using the MAC password, and encrypt the first data and the MAC value using the second password to obtain the second data; sending the second data to a second device; Wherein, the first password and the second password are generated using random passwords input by the user; Before establishing a wireless communication link with the second device, the method further includes: Install the SIM card; Receiving the random password input by the user; Using the authentication APPLET on the SIM card to sign the random password to generate the signature data; The first password and the second password are generated by the trusted application TA from the random password.

2. The method for offline migration of trusted execution environment data according to claim 1, It is characterized in that The legality check includes: Generate a first random number, and send the certificate of the first device and the first random number to the second device; receiving a second random number, a certificate of the second device, a second session key factor, and second signature data sent by the second device; verifying the certificate of the second device and the second signature data, and generating a first session key factor and a first signature data; generating the second password using the first session key factor and the second session key factor; sending the first session key factor and the first signature data to the second device; Receive a security channel establishment confirmation result from the second device.

3. A trusted execution environment data offline migration method, It is characterized in that Executed by a second device, the method includes: Establishing a wireless communication link with the first device and performing a legitimacy check; receiving second data sent by the first device; Decrypting the second data using the second password to obtain the first data and the MAC value; Verify the MAC value, decrypt the first data using the first password, and obtain original data and signature data; Verifying the signature data using a random password input by a user; Encrypting and saving the original data using a trusted application TA key; Wherein, the first password and the second password are generated using random passwords input by the user; Before establishing a wireless communication link with the first device, the method further includes: Install the SIM card; Receiving the random password input by the user; The first password and the second password are generated by the trusted application TA from the random password.

4. The method for offline migration of trusted execution environment data according to claim 3, It is characterized in that The legality check includes: Receiving a first random number sent by a first device and a certificate of the first device; verifying the certificate of the first device, generating a second random number, a second session key factor, and a second signature data; sending a second random number, a certificate of the second device, a second session key factor, and a second signature data to the first device; receiving a first session key factor and first signature data sent by a first device; Verifying the first signature data using the certificate of the first device, and generating the second password using the first session key factor and the second session key factor after the verification is successful; The secure channel establishment confirmation result is sent to the first device.

5. A trusted execution environment data offline migration device, It is characterized in that Applied to a first device, comprising a transceiver and a processor, The processor is used to establish a wireless communication link with the second device and perform a legitimacy check; decrypt the data to be transmitted to generate original data, and encrypt the original data and the signature data using the first password to obtain the first data; Calculate the MAC value of the first data using the MAC password, and encrypt the first data and the MAC value using the second password to obtain the second data; The transceiver is used to send the second data to a second device; Wherein, the first password and the second password are generated using random passwords input by the user; The processor is also used to install a SIM card; The transceiver is also used to receive the random password input by the user; The processor is further configured to use the authentication APPLET on the SIM card to sign the random password to generate the signature data; and to generate the first password and the second password from the random password through a trusted application TA.

6. A trusted execution environment data offline migration device, It is characterized in that applied to a second device, comprising a transceiver and a processor, The processor is used to establish a wireless communication link with the first device and perform a legitimacy check; The transceiver is used to receive second data sent by the first device; The processor is further configured to decrypt the second data using the second password to obtain the first data and the MAC value; verify the MAC value, decrypt the first data using the first password to obtain the original data and the signature data; and verify the signature data using the random password input by the user; Encrypting and saving the original data using a trusted application TA key; Wherein, the first password and the second password are generated using random passwords input by the user; The processor is also used to install a SIM card; The transceiver is also used to receive the random password input by the user; The processor is further configured to generate the first password and the second password from the random password through a trusted application TA.

7. A trusted execution environment data offline migration device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; It is characterized in that When the processor executes the program, the method for offline migration of trusted execution environment data as described in any one of claims 1-2 or the method for offline migration of trusted execution environment data as described in any one of claims 3-4 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps in the method for offline migration of trusted execution environment data as described in any one of claims 1-2 or the method for offline migration of trusted execution environment data as described in any one of claims 3-4 are implemented.