CN115129518A - Backup and recovery method, device, equipment and medium for TEE (trusted execution environment) stored data - Google Patents

Backup and recovery method, device, equipment and medium for TEE (trusted execution environment) stored data Download PDF

Info

Publication number
CN115129518A
CN115129518A CN202211023632.0A CN202211023632A CN115129518A CN 115129518 A CN115129518 A CN 115129518A CN 202211023632 A CN202211023632 A CN 202211023632A CN 115129518 A CN115129518 A CN 115129518A
Authority
CN
China
Prior art keywords
backup
data
trusted program
trusted
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211023632.0A
Other languages
Chinese (zh)
Other versions
CN115129518B (en
Inventor
曹京奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202211023632.0A priority Critical patent/CN115129518B/en
Publication of CN115129518A publication Critical patent/CN115129518A/en
Application granted granted Critical
Publication of CN115129518B publication Critical patent/CN115129518B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/606Protecting data by securing the transmission between two devices or processes

Abstract

The disclosure provides a backup and recovery method, device, equipment and medium for data stored in a TEE, relates to the technical field of data processing, particularly relates to the technical field of trusted computing and block chaining, and can be used for cloud computing. The specific implementation scheme is as follows: acquiring a backup request; the backup request comprises identification information of a backup trusted program in a backup machine; generating data to be transmitted according to an original ciphertext of the sealed data in the local trusted execution environment; and sending the data to be transmitted to the backup trusted program according to the identification information of the backup trusted program, so that the backup trusted program determines a sealed data plaintext according to the data to be transmitted, and performs related encryption backup on the sealed data plaintext and the service trusted program in a local TEE. According to the technology of the present disclosure, backup of stored data inside a trusted execution environment is achieved.

Description

Backup and recovery method, device, equipment and medium for TEE (trusted execution environment) stored data
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to the field of trusted computing and block chaining technologies, which may be used for cloud computing, and in particular, to a method, an apparatus, a device, and a medium for backing up and restoring data stored in a TEE.
Background
When encrypted storage of data is performed in a Trusted Execution Environment (TEE) of a Trusted device, an encryption key of the Trusted Execution Environment is usually hard-coded in a CPU (Central Processing Unit). Since the encryption is performed at the hardware level of the CPU, the encryption key cannot be obtained from the outside to illegally decrypt data. Because the encryption key has no possibility of leakage, the storage data in the trusted execution environment can not be cracked and stolen. However, when the CPU hardware of the trusted device is damaged or destroyed, the stored data will be permanently lost and cannot be found.
Disclosure of Invention
The disclosure provides a method, a device, equipment and a medium for backing up and recovering storage data in a TEE (trusted execution environment), so as to realize backing up and recovering the storage data in the trusted execution environment.
According to an aspect of the present disclosure, there is provided a backup method for storing data in a TEE, which is executed by a service trusted program of a service machine, including:
acquiring a backup request; the backup request comprises identification information of a backup trusted program in a backup machine;
generating data to be transmitted according to an original ciphertext of the sealed data in the local trusted execution environment;
and sending the data to be transmitted to the backup trusted program according to the identification information of the backup trusted program, so that the backup trusted program determines a sealed data plaintext according to the data to be transmitted, and performs related encryption backup on the sealed data plaintext and the service trusted program in a local trusted execution environment.
According to another aspect of the present disclosure, a backup method for data stored in a TEE is provided, which is executed by a backup trusted program of a backup machine, and includes:
acquiring data to be transmitted; the data to be transmitted is generated by a service trusted program in a service machine according to an original ciphertext of sealed data in a local trusted execution environment, and is transmitted according to identification information of a backup trusted program in an acquired backup request;
determining a sealed data plaintext according to the data to be transmitted;
and associating the sealed data plaintext with the service trusted program in a local trusted execution environment for encryption and backup.
According to another aspect of the present disclosure, there is provided a method for recovering data stored in a TEE, which is performed by a service trusted program of a recovery machine, including:
acquiring a recovery request; the recovery request comprises identification information of a backup trusted program in the backup machine;
acquiring self-associated data to be transmitted from the backup trusted program according to the identification information of the backup trusted program, and determining a plaintext of corresponding sealed data according to the data to be transmitted;
and encrypting and storing the sealed data plain text into a local trusted execution environment.
According to another aspect of the present disclosure, there is provided a method for restoring data stored in a TEE, which is performed by a backup trusted program of a backup machine, including:
determining to-be-transmitted data associated with a service trusted program stored in a local trusted execution environment;
and sending the data to be transmitted to the service trusted program so that the service trusted program determines a corresponding sealed data plaintext according to the data to be transmitted, and encrypting and storing the sealed data plaintext into a local trusted execution environment.
According to another aspect of the present disclosure, there is also provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the backup methods for storing data within a TEE provided by embodiments of the present disclosure.
According to another aspect of the present disclosure, there is also provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the methods of restoring data stored within a TEE provided by embodiments of the present disclosure.
According to another aspect of the present disclosure, there is also provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to execute any one of the backup methods of data stored within a TEE provided by the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is also provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform any one of the methods for restoring data stored within a TEE provided by the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is also provided a computer program product, including a computer program, which when executed by a processor, implements any one of the backup methods for storing data within a TEE provided by the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is also provided a computer program product, including a computer program, which when executed by a processor, implements any one of the methods for restoring data stored within a TEE provided by the embodiments of the present disclosure.
According to the technology disclosed by the invention, the backup and the recovery of the storage data inside the trusted execution environment are realized.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram of a backup method for storing data in a TEE according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of another method for backing up data stored within a TEE according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of another backup method for storing data in a TEE according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of another backup method for storing data in a TEE according to an embodiment of the present disclosure;
fig. 5A is a schematic diagram of another backup method for storing data in a TEE according to an embodiment of the present disclosure;
FIG. 5B is an interaction flow diagram of a backup method for storing data within a TEE according to an embodiment of the present disclosure;
fig. 6A is a schematic diagram of another backup method for storing data in a TEE according to an embodiment of the present disclosure;
FIG. 6B is an interaction flow diagram of a backup method for storing data within a TEE according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a method for recovering data stored in a TEE according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of another method for restoring data stored within a TEE according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of another method for restoring data stored in a TEE according to an embodiment of the present disclosure;
FIG. 10 is a schematic diagram of another method for restoring data stored in a TEE according to an embodiment of the present disclosure;
FIG. 11A is a schematic diagram of yet another method for restoring data stored within a TEE according to an embodiment of the present disclosure;
FIG. 11B is an interaction flow diagram of a method for restoring stored data within a TEE according to an embodiment of the present disclosure;
FIG. 12A is a schematic diagram illustrating a further method for restoring data stored within a TEE according to an embodiment of the present disclosure;
FIG. 12B is an interaction flow diagram of a method for restoring stored data within a TEE according to an embodiment of the present disclosure;
FIG. 13 is a block diagram of a backup device storing data within a TEE according to an embodiment of the present disclosure;
FIG. 14 is a block diagram of a backup device storing data within a TEE according to an embodiment of the present disclosure;
FIG. 15 is a block diagram of a recovery apparatus for storing data within a TEE according to an embodiment of the present disclosure;
FIG. 16 is a block diagram of a recovery apparatus for data stored in a TEE according to an embodiment of the disclosure;
fig. 17 is a block diagram of an electronic device used to implement a method of backup and/or recovery of in-memory data within a TEE according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The backup method for the data stored in each TEE and the backup device for the data stored in the TEE provided by the embodiment of the disclosure are suitable for an application scene of backing up the data stored in a trusted execution environment. The backup method for the data stored in each TEE provided by the embodiment of the present disclosure may be executed by a backup device for the data stored in the TEE, where the device may be implemented by software and/or hardware, and is specifically configured in an electronic device, and the electronic device may be a service machine.
For ease of understanding, the backup method for storing data within a TEE provided by the present disclosure will first be described in detail.
Referring to fig. 1, a backup method for stored data in a TEE is executed by a service trusted program of a service machine, and includes:
s110, obtaining a backup request; the backup request comprises identification information of a backup trusted program in the backup machine.
The backup request may be a request for backing up data stored in the service machine, and the backup request may be initiated by a requester requiring data backup. The service machine may be a server deployed with a TEE for performing service processing. The stored data within the server is preserved in the TEE and there is no possibility of leakage.
Wherein, the backup request can be obtained by a service trusted program of the service machine. The business trusted program may be an application deployed within the business machine for responding to the backup request. At least one service trusted program can be included in the service machine, and different service trusted execution programs can respond to backup requests initiated by different demanders.
The backup machine may be a server for performing backup storage on encrypted data in the service machine. The backup trusted program in the backup machine may be an application deployed within the backup machine for performing data backup. The backup machine may include at least one backup trusted program, and different backup trusted execution programs may back up stored data corresponding to the same or different service trusted programs.
The identification information of the backup trusted program is used for uniquely representing the identity information of the backup trusted program. For example, the identification information may be a program identifier of the backup trusted program, and program identifiers of different backup trusted programs in the same backup machine are different, and a unique backup trusted program may be accessed through the program identifiers.
Optionally, the identification information may also be address information of the backup trusted program. For example, the address information may include a backup machine address and a program identifier of the backup trusted program. The backup machine address is used for positioning the backup machine, and the program identification is used for positioning the only backup trusted program under the backup machine.
For example, the backup demander may send a backup request for backing up data to the service machine according to an actual data backup requirement of the backup demander, and a service trusted program of the service machine obtains the backup request. The backup request comprises identification information of a backup trusted program in the backup machine. The backup machine for data backup and the backup trusted program in the backup machine may be determined by the backup requiring party according to the actual requirement, or may be randomly determined by the initiating device of the backup request, which is not limited in this embodiment.
And S120, generating data to be transmitted according to the original ciphertext of the sealed data in the local TEE.
The local TEE may be a TEE deployed inside a service trusted program of the service machine. The original ciphertext of the sealed data may be encrypted data obtained by encrypting the sealed data based on the data sealing capability of the CPU hardware of the service machine. The sealed data can be privacy data or important data generated in the data processing process in the business machine.
The data to be transmitted may be data transmitted from the service trusted program of the service machine to the backup trusted program of the backup machine in the backup process, and is used as a basis for performing sealed data backup by the backup trusted program.
It can be understood that, because the original ciphertext of the sealed data is obtained by encrypting the sealed data by the encryption key at the CPU hardware level inside the service machine, and the CPU hardware encryption key cannot be known from the outside to illegally decrypt the data, the original ciphertext of the sealed data can only be decrypted by the CPU hardware encryption key of the service machine itself, thereby obtaining the plaintext of the sealed data.
Illustratively, the service trusted program of the service machine may decrypt the original ciphertext of the sealed data through the CPU hardware encryption key to obtain a sealed data plaintext, and use the sealed data plaintext as the data to be transmitted.
Optionally, in order to improve the security of data transmission, the plaintext of the sealed data may be encrypted based on a preset encryption algorithm, and the encrypted plaintext of the sealed data is used as the data to be transmitted.
S130, sending the data to be transmitted to the backup trusted program according to the identification information of the backup trusted program, so that the backup trusted program determines a sealed data plaintext according to the data to be transmitted, and the sealed data plaintext and the service trusted program are encrypted and backed up in a local TEE in a related mode.
For example, the service trusted program may determine, according to the identification information of the backup trusted program, a backup trusted program in the backup machine for receiving and executing data backup, and send the data to be transmitted to the backup trusted program.
If the data to be transmitted is the sealed data plaintext, the backup trusted program can directly perform associated encryption backup on the sealed data plaintext and the service trusted program in the local TEE of the backup machine.
If the data to be transmitted is the encrypted sealed data plaintext, the backup trusted program may decrypt the data to be transmitted based on a preset encryption algorithm and a corresponding decryption algorithm to obtain the sealed data plaintext, and perform associated encryption backup on the sealed data plaintext and the service trusted program in the local TEE of the backup machine.
The mode of the seal data plaintext and the service trusted program in the local TEE for related encryption backup can be that the backup trusted program encrypts the seal data plaintext based on a hard-coded key of the backup trusted program to obtain a seal data ciphertext, and the seal data ciphertext and the service trusted program are backed up and stored in the local TEE of the backup machine.
It should be noted that the sealed data ciphertext and the service trusted program are backed up and stored in the local TEE of the backup machine, or the sealed data ciphertext and the identification information of the service trusted program are stored in the local TEE of the backup machine in a correlated manner, so that the subsequent ciphertext data of the sealed data in the backup machine can be conveniently located through the identification information of the service trusted program. The identification information may be a program identification, and is used to uniquely characterize the service trusted program. Optionally, the sealed data plaintext and the service trusted program may be associated with each other in a disk of the local TEE of the backup machine for encryption and backup, so as to implement persistent storage of the data.
According to the scheme of the embodiment of the invention, the data to be transmitted is generated by the service trusted program according to the original ciphertext of the sealed data in the local TEE, and the data to be transmitted is sent to the backup trusted program according to the identification information of the backup trusted program, so that the backup trusted program determines the sealed data plaintext, and the sealed data plaintext and the service trusted program are encrypted and backed up in a local TEE in a correlated manner, thereby realizing the backup storage of the sealed data in the trusted execution environment of the service machine and avoiding the permanent loss of the sealed data caused by the fault or damage of the service machine.
On the basis of the above technical solutions, in order to facilitate management of backup data of different versions, optionally, a version identifier may also be added in the backup request, and during data recovery, data recovery may be performed on a specified version. The version identification can be specified by the backup demander, and the version identification specified by the backup demander can directly perform data coverage under the condition that the same version identification is stored, so that the condition that the later recovery is affected due to the fact that the backup data of a certain version is mistaken is prevented.
Optionally, when the types of the backup data are many, a timestamp, an information identifier, and the like may be added to the backup request to generate a backup data identifier, which facilitates subsequent positioning of the backed-up data through the backup data identifier.
Optionally, in order to reduce transitional occupation of the memory space of the backup machine and meet the requirement for diversified management of backup data, a deletion mechanism may be introduced to delete the specified version identifier. Specifically, when the backup data needs to be deleted, a deletion request of the backup data of the designated version may be generated, and after the backup machine obtains the deletion request, the backup data of the designated version is correspondingly deleted.
The version identifier may also be automatically generated by the backup machine or the service machine, for example, the identifier generation period may be preset by a relevant technician, and when the set identifier generation period is reached, the backup machine or the service machine automatically generates the version identifier. For example, the preset identification generation period may be 24 hours.
It should be noted that the backup request is usually initiated by the peripheral management system, not the service machine. For example, the peripheral management system may be an operation and maintenance platform. The backup request can be initiated by the operation and maintenance platform at regular time. For example, a timing task can be preset and triggered by the operation and maintenance platform.
On the basis of the technical schemes, the disclosure also provides an optional embodiment, in which the data to be transmitted is refined into sealed data plaintext; correspondingly, the operation of sending the data to be transmitted to the backup trusted program according to the identification information of the backup trusted program is further refined into the operation of verifying the backup trusted program; after the verification is passed and the backup trusted program passes the verification of the business trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program; and sending sealed data plaintext' to the backup trusted program through the secure trusted channel so as to perfect a data transmission mechanism based on the secure trusted channel. It should be noted that, for parts not described in detail in the embodiments of the present disclosure, reference may be made to related expressions in other embodiments, and details are not described herein again.
Referring to fig. 2, a method for backing up data stored in a TEE is shown, which is executed by a service trusted program of a service machine, and includes:
s210, obtaining a backup request; the backup request comprises identification information of a backup trusted program in the backup machine.
S220, generating data to be transmitted according to the original ciphertext of the sealed data in the local TEE; the data to be transmitted is sealed data plaintext.
It should be noted that the service trusted program may directly establish a data transmission channel with the backup trusted program, and send the data to be transmitted to the backup trusted program through the established data transmission channel. However, the problem of data leakage exists when a data transmission channel is established, so in order to improve the security of data transmission, the service trusted program and the backup trusted program can also perform mutual authentication, and after the authentication is passed, a secure trusted channel for transmitting the data to be transmitted is established.
And S230, verifying the backup trusted program.
The verification of the backup trusted program may be to verify whether the backup trusted program is a trusted program, that is, to verify whether the backup trusted program is in a trusted execution environment. For example, existing remote verification techniques may be employed to verify that the backup trusted program is a trusted program. For example, existing SGX-based remote authentication techniques may be employed to perform trusted execution environment authentication of the backup trusted program.
In order to further improve the safety of the backup trusted program, the correctness of the backup trusted program can be verified.
In an optional embodiment, fingerprint information of the backup trusted program can be hard-coded in the service trusted program in advance; verifying the backup trusted program, including: verifying the trusted execution environment of the backup trusted program; and if the verification is passed, performing program fingerprint verification on the backup trusted program according to the consistency of the fingerprint information of the backup trusted program carried in the verification result and the hard-coded fingerprint information in the service trusted program.
It can be understood that, in order to prevent the fingerprint information of the backup trusted program from being maliciously tampered, the fingerprint information of the backup trusted program may be hard-coded in advance in the service trusted program. The fingerprint information may be a digest hash of the backup trusted program.
If the trusted execution environment of the backup trusted program passes the verification, fingerprint information of the backup trusted program can be acquired from the verification result, and fingerprint verification of the backup trusted program is further performed; if the verification of the trusted execution environment of the backup trusted program is not passed, the verification of the backup trusted program is directly determined to be not passed, and the fingerprint verification of the backup trusted program is not required, so that the waste of computing resources is reduced.
For example, if the trusted execution environment of the backup trusted program passes the verification, fingerprint information of the backup trusted program is obtained from the verification result. The service trusted program can compare the information consistency of the fingerprint information acquired from the verification result with the fingerprint information of the hard-coded backup trusted program stored in the service trusted program; if the fingerprint information is consistent, the program fingerprint of the backup trusted program is considered to pass the verification, namely the backup trusted program is consistent with the backup trusted program required by the service trusted program, and the verification of the backup trusted program is indicated to pass at the moment; if the fingerprint information is inconsistent, the program fingerprint verification of the backup trusted program is not passed, that is, the backup trusted program is inconsistent with the backup trusted program required by the service trusted program, and the verification of the backup trusted program is not passed at this moment.
According to the scheme of the optional embodiment, the backup trusted program is subjected to trusted execution environment verification, and program fingerprint verification is performed on the backup trusted program according to the fingerprint information of the backup trusted program carried in the verification result, so that the comprehensiveness of the verification on the backup trusted program is realized, the verification accuracy of the backup trusted program is further improved, and the situation of data safety hidden trouble caused by malicious spoofing of the backup trusted program by a third party is avoided.
S240, after the verification is passed and the backup trusted program passes the verification of the business trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program.
The verification of the service trusted program by the backup trusted program may include verification of a trusted execution environment of the service trusted program, and may specifically be implemented by using an existing trusted execution environment verification technology, for example, an SGX-based remote verification technology.
Illustratively, in the process of verifying the backup trusted program by the service trusted program, the backup trusted program verifies the trusted execution environment of the service trusted program; and after the backup trusted program passes the verification of the business trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program.
It should be noted that, in the embodiment, the order of the verification between the verification of the service trusted program and the verification of the service trusted program by the backup trusted program is not limited. The business trusted program can verify the backup trusted program before the business trusted program verifies the business trusted program; or the backup trusted program verifies the service trusted program before the service trusted program verifies the backup trusted program; or the verification of the backup trusted program and the business trusted program can be carried out simultaneously or alternately.
It should be noted that, in the solution of this embodiment, the steps of S220, S230, and S240 may be sequentially executed, that is, data to be transmitted is generated first, and then a secure trusted channel is established. Alternatively, S230-S240 may also be performed before S220, that is, a secure trusted channel is established first, and then data to be transmitted is generated. The steps of establishing the secure trusted channel and generating the data to be transmitted are not limited in this embodiment.
And S250, sending the sealed data plaintext to the backup trusted program through the safe trusted channel, so that the backup trusted program can encrypt and backup the sealed data plaintext and the service trusted program in a local TEE in a related manner.
The secure trusted channel may be a channel only used for secure data transmission between the backup trusted program and the service trusted program. The data transmitted in the secure trusted channel cannot be known by third parties other than the business trusted program and the backup trusted program.
Optionally, after the backup trusted program verifies the service trusted program, fingerprint information of the service trusted program carried in the verification result may be acquired. Correspondingly, the mode of the backup trusted program to encrypt and backup the obtained sealed data plaintext in a correlated manner can be to bind the sealed data plaintext with the fingerprint information of the service trusted program to obtain binding information, and to store the binding information in the local TEE in a backup and encrypted manner. In order to facilitate the search and acquisition of the sealed data, a sealed data ciphertext obtained by encrypting a sealed data plaintext through a local CPU hard-coded key can be bound and stored with the fingerprint information of the service trusted program in the local TEE.
It should be noted that, by binding and storing the fingerprint information of the service trusted program and the sealed data plaintext, data stealing from the backup trusted program by other trusted programs can be avoided, and data security in the backup trusted program is ensured.
According to the scheme of the embodiment of the invention, mutual authentication of the business trusted program and the backup trusted program is realized by verifying the backup trusted program and establishing a safe trusted channel between the business trusted program and the backup trusted program after the verification is passed and the backup trusted program passes the verification of the business trusted program, so that the situation that the backup trusted program is not a backup trusted program or a backup trusted program encoded by hardware or data is stolen by pretending the backup trusted program is avoided, and the safety of data transmission from the business trusted program to the backup trusted program is ensured. Meanwhile, data transmission is carried out between the service trusted program and the backup trusted program through the safe trusted channel, introduction of a third party is reduced, and the data transmission process is more convenient and faster.
On the basis of the above technical solutions, the present disclosure also provides an optional embodiment, in which an operation of "generating data to be transmitted according to an original ciphertext of sealed data in a local TEE" is further refined into "acquiring a backup transmission public key of a backup trusted program from a block chain according to identification information of the backup trusted program; decrypting the original ciphertext in the local TEE to obtain a sealed data plaintext, and encrypting the sealed data plaintext according to the backup transmission public key to obtain a backup transmission ciphertext of the sealed data; and generating data to be transmitted which comprises the backup transmission ciphertext. Correspondingly, the operation of sending the data to be transmitted to the backup trusted program according to the identification information of the backup trusted program so as to enable the backup trusted program to determine the sealed data plaintext according to the data to be transmitted is further refined into the operation of linking and storing the data to be transmitted and the identification information of the backup trusted program so as to enable the backup trusted program to obtain the data to be transmitted on a link according to the identification information of the backup trusted program, and decrypting the data to be transmitted according to the backup transmission private key corresponding to the backup transmission public key so as to obtain the sealed data plaintext, so that a data transmission mechanism based on a block link is completed. It should be noted that, for parts not described in detail in the embodiments of the present disclosure, reference may be made to related expressions in other embodiments, and details are not described herein again.
Referring to fig. 3, a backup method for stored data in a TEE is executed by a service trusted program of a service machine, and includes:
s310, obtaining a backup request; the backup request comprises identification information of a backup trusted program in the backup machine.
It can be understood that the data to be backed up may be stored by combining with the block chain technology, which can prevent the backup data from being lost due to the damage of the backup machine, and at the same time, can ensure the evidence storage on the block chain without reducing the data security.
And S320, acquiring a backup transmission public key of the backup trusted program from the block chain according to the identification information of the backup trusted program.
And the block chain is also stored with a backup transmission public key corresponding to the backup trusted program and used for encrypting data. The block chain may store identification information of at least one backup trusted program corresponding to at least one backup machine, thereby implementing multi-copy backup of sealed data. And different backup trusted programs are distinguished through corresponding identification information.
It should be noted that the identification information of the backup trusted program in the block chain has a corresponding relationship with the backup transmission public key, and the only corresponding backup transmission public key can be obtained through the identification information of the backup trusted program.
For example, the service trusted program may obtain, from the block chain, the backup transmission public key of the backup trusted program corresponding to the identification information according to the identification information of the backup trusted program in the obtained backup request.
S330, decrypting the original ciphertext in the local TEE to obtain a sealed data plaintext, and encrypting the sealed data plaintext according to the backup transmission public key to obtain a backup transmission ciphertext of the sealed data.
And S340, generating data to be transmitted, wherein the data to be transmitted comprises the backup transmission ciphertext.
And S350, associating and chaining the data to be transmitted and the identification information of the backup trusted program for storage so that the backup trusted program can obtain the data to be transmitted on the chain according to the identification information of the backup trusted program, decrypting the data to be transmitted according to the backup transmission private key corresponding to the backup transmission public key to obtain a sealed data plaintext, and associating and encrypting the sealed data plaintext and the service trusted program in the local TEE for backup.
Illustratively, the service trusted program can decrypt an original ciphertext of the sealed data in the local TEE through a CPU hardware encryption key to obtain a sealed data plaintext; encrypting the sealed data plaintext through the backup transmission public key to obtain the encrypted sealed data plaintext; and taking the encrypted plaintext of the sealed data as a backup transmission ciphertext of the sealed data as a generation basis of the data to be transmitted.
For example, the backup transmission ciphertext may be directly used as the data to be transmitted.
The backup transmission private key of the backup trusted program corresponds to the backup transmission public key and is used for decrypting the sealed data ciphertext data.
Illustratively, the business trusted program stores the data to be transmitted and the identification information of the backup trusted program in a block chain in an associated manner. The backup trusted program can acquire the data to be transmitted which is stored in association with the identification information of the backup trusted program from the block chain according to the identification information of the backup trusted program, and decrypt the data to be transmitted through a backup transmission private key of the backup trusted program to obtain a sealed data plaintext. And the backup trusted program is used for carrying out related encryption backup on the sealed data plaintext and the service trusted program in the local TEE.
It can be understood that, in order to improve the security of data transmission and data backup, bidirectional authentication can be performed between the business trusted program and the backup trusted program, and data transmission and backup are performed after the authentication is passed.
In an optional embodiment, the blockchain further stores remote authentication information of the backup trusted program; correspondingly, according to the identification information of the backup trusted program, the remote verification information of the backup trusted program is obtained from the block chain; verifying the backup trusted program according to the remote verification information of the backup trusted program; and if the verification is passed, triggering and executing the cochain storage operation of associating the data to be transmitted and the identification information of the backup trusted program.
The remote authentication information may be used to authenticate the trusted execution environment for the backup trusted program. The block chain stores remote verification information and a backup transmission public key of a backup trusted program. The remote verification information and the backup transmission public key of the backup trusted program stored in the block chain have a corresponding relation with the identification information of the backup trusted program, so that the remote verification information and the backup transmission public key corresponding to the remote verification information and the backup transmission public key can be acquired through the identification information of the backup trusted program.
Illustratively, the service trusted program may obtain, from the block chain, remote verification information of the backup trusted program corresponding to the identification information, according to the identification information of the backup trusted program; the service trusted program can perform trusted execution environment verification on the remote verification information of the backup trusted program through the existing verification technology.
For example, the remote authentication information may be generated based on hash data of the backup transmission public key, and thus, the hash data of the backup transmission public key may be carried in the remote authentication information. The hash data of the backup transmission public key may be encrypted data obtained by hashing the backup transmission public key through a preset hash algorithm. Correspondingly, in order to further improve the verification accuracy of the backup trusted program, the accuracy of the backup trusted program can be verified according to the remote verification information and the backup transmission public key of the backup trusted program. For example, the verification of the backup trusted program may include an accuracy verification of a backup transmission public key of the backup trusted program, and an accuracy verification of a program fingerprint of the backup trusted program.
In an optional embodiment, the verifying the backup trusted program according to the remote verification information of the backup trusted program and the backup transmission public key includes: and verifying the backup transmission public key according to the hash data of the backup transmission public key in the remote verification information of the backup trusted program.
The remote verification information carries hash data of a backup transmission public key of the backup trusted program.
Exemplarily, the service trusted program may perform hash calculation on the backup transmission public key obtained from the link to obtain first hash data of the backup transmission public key; taking the hash data of the backup transmission public key in the remote verification information acquired from the chain as second hash data; the business credible program carries out consistency comparison on the first hash data and the second hash data, and if the comparison result is consistent, the verification of the backup transmission public key of the backup credible program is considered to be passed; and if the comparison result is inconsistent, the verification of the backup transmission public key of the backup trusted program is not passed.
According to the optional embodiment, the backup transmission public key is verified according to the hash data of the backup transmission public key in the remote verification information of the backup trusted program, so that the backup transmission public key of the backup trusted program is accurately verified, and the verification accuracy of the backup trusted program is further improved.
In an optional embodiment, the verifying the backup trusted program according to the remote verification information and the backup transmission public key of the backup trusted program includes: and performing program fingerprint verification on the backup trusted program according to the consistency of the fingerprint information of the backup trusted program in the remote verification information of the backup trusted program and the hard-coded fingerprint information in the service trusted program.
It should be noted that the remote verification information includes fingerprint information of the backup trusted program itself; the service trusted program comprises fingerprint information of a backup trusted program which is hard-coded in advance.
Illustratively, the service trusted program acquires fingerprint information of the backup trusted program from the acquired remote verification information of the backup trusted program, and performs consistency comparison with the fingerprint information of the backup trusted program hard-coded by the service trusted program; if the comparison result is consistent, the program fingerprint of the backup trusted program is considered to pass the verification; and if the comparison result is inconsistent, the program fingerprint of the backup trusted program is not verified.
In the optional embodiment, the program fingerprint verification is performed on the backup trusted program by comparing the fingerprint information of the backup trusted program in the remote verification information with the consistency of the hard-coded fingerprint information in the service trusted program, so that the accurate verification of the program fingerprint of the backup trusted program is realized, and the verification accuracy of the backup trusted program is further improved.
According to the scheme of the optional embodiment, the remote verification information of the backup trusted program is obtained from the block chain, and the backup trusted program is verified through the remote verification information, so that the safety verification of the backup trusted program by the service trusted program is realized, and the condition of data safety hazard caused by malicious impersonation of the backup trusted program by a third party and uplink storage of related information of the backup trusted program is avoided.
For example, if the verification of the backup transmission public key of the backup trusted program and the verification of the program fingerprint both pass by the service trusted program, it indicates that the verification of the backup trusted program passes. And if the business trusted program verifies the backup transmission public key of the backup trusted program or the program fingerprint fails to verify, the verification of the backup trusted program is not passed.
It can be understood that, in order to avoid acquiring the data to be transmitted of the wrong service trusted program on the backup trusted program chain, the data to be transmitted may also carry remote verification information of the service trusted program, which is convenient for the backup trusted program to verify the service trusted program.
In an optional embodiment, generating data to be transmitted including a backup transmission ciphertext includes: generating remote verification information of the service trusted program according to the hash data of the backup transmission ciphertext; and generating data to be transmitted, which comprises the backup transmission ciphertext and the remote verification information of the service trusted program, so that the backup trusted program verifies the backup transmission ciphertext according to the remote verification information of the service trusted program.
Illustratively, the service trusted program may carry hash data of the backup transmission ciphertext, and generate remote verification information of the service trusted program based on the existing remote verification technology.
And the service trusted program generates data to be transmitted, which comprises the backup transmission ciphertext and the remote verification information of the service trusted program, and the data is linked and stored with the identification information of the backup trusted program.
The backup trusted program can acquire the data to be transmitted corresponding to the identification information of the backup trusted program from the chain according to the identification information of the backup trusted program; and acquiring remote verification information of the backup transmission ciphertext and the service trusted program from the data to be transmitted, and verifying the backup transmission ciphertext according to the remote verification information.
Optionally, the backup trusted program may perform trusted execution environment verification on the service trusted program according to the remote verification information of the service trusted program based on the existing remote verification technology.
Since the remote verification information of the service trusted program carries the hash data of the backup transmission ciphertext, optionally, the backup trusted program may also verify the backup transmission ciphertext according to a matching condition between the backup transmission ciphertext and the hash data of the backup transmission ciphertext carried in the remote verification information of the service trusted program.
In the optional embodiment, the remote verification information of the service trusted program is generated according to the hash data of the backup transmission ciphertext, and the to-be-transmitted data including the backup transmission ciphertext and the remote verification information of the service trusted program is generated; the backup trusted program can verify the backup transmission ciphertext through the data to be transmitted, so that the backup trusted program can verify the service trusted program, the condition that the service trusted program is fake or the backup transmission ciphertext is maliciously tampered is avoided, and the safety and the accuracy of data transmission are improved.
It can be understood that there may be a possibility of damage to the backup machine used to store the backup data, and if the backup machine is damaged, the sealed data in the backup machine will be permanently lost and cannot be recovered. Therefore, the method can perform multi-copy backup on the sealed data needing to be backed up, and when one backup machine is damaged, the sealed data can be obtained from other backup machines and recovered.
In an optional embodiment, the number of the backup trusted programs is at least two, and the fingerprint information of different backup trusted programs is the same.
For example, the same backup trusted program may be deployed on different backup machines, and the fingerprint information of the same backup trusted program deployed on different backup machines is the same. The backup machine addresses corresponding to the same backup trusted program on different backup machines can be different, but the functions realized by the same backup trusted program are the same. In the subsequent recovery process of the sealed data, the recovery of the sealed data can be realized through a corresponding backup trusted program in any backup machine for storing the sealed data.
The optional embodiment realizes high availability of the service by deploying the same backup trusted program on a plurality of backup machines, and avoids the situation that the sealed data cannot be recovered when one backup machine is damaged.
According to the scheme of the embodiment of the disclosure, the backup transmission public key of the backup trusted program is acquired from the block chain, the sealed data plaintext is encrypted according to the backup transmission public key, the to-be-transmitted data including the backup transmission ciphertext of the sealed data is obtained, and the to-be-transmitted data and the identification information of the backup trusted program are linked and stored. According to the scheme, the block chain is introduced, and the data to be transmitted are stored in the block chain, so that the condition that the backup machine is damaged to cause data loss is prevented. And the data is stored on the block chain, so that the safety of the data is improved.
The technical scheme takes the service machine as an execution main body and explains the backup method for storing data in the TEE. Hereinafter, a backup method of storing data in the TEE will be described in detail, with the backup machine as an execution main body. It should be noted that, in the embodiment, reference may be made to related descriptions of other embodiments, which are not detailed.
Referring to fig. 4, a backup method for storing data in a TEE is executed by a backup trusted program of a backup machine, and includes:
s410, acquiring data to be transmitted; and the data to be transmitted is generated by a service trusted program in the service machine according to an original ciphertext of the sealed data in the local TEE, and is transmitted according to the identification information of the backup trusted program in the acquired backup request.
The data to be transmitted may be data transmitted from the service trusted program of the service machine to the backup trusted program of the backup machine in the backup process, and is used as a basis for performing sealed data backup by the backup trusted program. The data to be transmitted may include a sealed data plaintext, or the data to be transmitted may include a ciphertext obtained by encrypting the sealed data plaintext based on a preset encryption algorithm.
The backup request may be a request for backing up encrypted data in the service machine, and the backup request may be initiated by a party requiring data backup. The service machine may be a server deployed with a TEE. The encrypted data within the server is stored in the TEE and there is no possibility of leakage.
Wherein, the backup request can be obtained by a service trusted program of the service machine. The business trusted program may be an application deployed within the business machine for responding to backup requests. At least one business trusted program can be included in the business machine, and different business trusted programs can respond to different backup requests.
The backup request comprises identification information of a backup trusted program in the backup machine. The backup machine can be a server for performing backup storage on the storage data in the business machine. The backup trusted program in the backup machine may be an application deployed within the backup machine for backing up data. The backup machine may include at least one backup trusted program, and different backup trusted programs may back up stored data corresponding to the same or different service trusted programs.
The identification information of the backup trusted program is used for uniquely representing the identity information of the backup trusted program. For example, the identification information may be a program identifier of the backup trusted program, and program identifiers of different backup trusted programs in the same backup machine are different, and a unique backup trusted program may be accessed through the program identifiers.
Optionally, the identification information may also be address information of the backup trusted program. For example, the address information may include a backup machine address and a program identifier of a backup trusted program. The backup machine address is used for positioning the backup machine, and the program identification is used for positioning the only backup trusted program under the backup machine.
The local TEE may be a TEE deployed inside a service trusted program of the service machine. The original ciphertext of the sealed data may be encrypted data obtained by encrypting the sealed data based on the data sealing capability of the CPU hardware of the service machine. The sealed data can be privacy data or important data generated in the data processing process in the business machine.
Because the original ciphertext of the sealed data can be obtained by encrypting the sealed data by the encryption key at the CPU hardware level in the service machine, and the illegal decryption of the data by the CPU hardware encryption key cannot be known from the outside, the original ciphertext of the sealed data can only be decrypted by the CPU hardware encryption key of the service machine, so that the plaintext of the sealed data is obtained.
Illustratively, the service trusted program of the service machine may decrypt the original ciphertext of the sealed data through the CPU hardware encryption key to obtain a sealed data plaintext, and use the sealed data plaintext as the data to be transmitted.
For example, the backup demander may send a backup request for backing up data to the service machine according to an actual data backup requirement of the backup demander, and a service trusted program of the service machine obtains the backup request. The backup request comprises identification information of a backup trusted program in the backup machine. And the service trusted program sends the acquired backup request to the backup machine, and the backup trusted program of the backup machine acquires the data to be transmitted.
And S420, determining a sealed data plaintext according to the data to be transmitted.
Exemplarily, if the data to be transmitted includes a sealed data plaintext, directly obtaining the sealed data plaintext from the data to be transmitted; and if the data to be transmitted comprises an encryption result of the sealed data plaintext based on the preset encryption algorithm, decrypting the encryption result based on the preset decryption algorithm corresponding to the preset encryption algorithm to obtain the sealed data plaintext.
And S430, the sealed data plaintext and the service trusted program are encrypted and backed up in a local TEE in a related mode.
Illustratively, the backup trusted program may perform associated encryption backup on the sealed data plaintext and the service trusted program in the backup machine local TEE.
The mode of the seal data plaintext and the service trusted program in the local TEE for related encryption backup can be that the backup trusted program encrypts the seal data plaintext based on a hard-coded key of the backup trusted program to obtain a seal data ciphertext, and the seal data ciphertext and the service trusted program are backed up and stored in the local TEE of the backup machine.
It should be noted that the sealed data ciphertext and the service trusted program are backed up and stored in the local TEE of the backup machine, or the sealed data ciphertext and the identification information of the service trusted program are stored in the local TEE of the backup machine in a correlated manner, so that the subsequent ciphertext data of the sealed data in the backup machine can be conveniently located through the identification information of the service trusted program. The identification information may be a program identifier, and is used to uniquely characterize the service trusted program.
Optionally, the sealed data plaintext and the service trusted program may be associated with each other in a disk of the local TEE of the backup machine for encryption and backup, so as to implement persistent storage of the data.
According to the scheme of the embodiment of the disclosure, the sealed data plaintext is determined according to the acquired to-be-transmitted data, and the sealed data plaintext and the service trusted program are encrypted and backed up in a local TEE in a related manner, so that the sealed data inside the trusted execution environment of the service machine can be backed up and stored, and the condition that the sealed data is permanently lost due to the fault or damage of the service machine is avoided.
On the basis of the above technical solutions, the present disclosure also provides an optional embodiment, in which the data to be transmitted is the sealed data plaintext; correspondingly, the operation of acquiring the data to be transmitted is further refined into the operation of verifying the service trusted program; after the verification is passed and the business trusted program passes the verification of the backup trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program; and acquiring the sealed data plaintext' through the secure trusted channel so as to perfect a data transmission mechanism based on the secure trusted channel. It should be noted that, for parts not described in detail in the embodiments of the present disclosure, reference may be made to related expressions in other embodiments, and details are not described herein again.
Referring to fig. 5A, a method for backing up data stored in a TEE is performed by a backup trusted program of a backup machine, and includes:
and S510, verifying the service trusted program.
It should be noted that a data transmission channel may be directly established between the service trusted program and the backup trusted program, and the data to be transmitted is sent to the backup trusted program through the established data transmission channel. However, the problem of data leakage exists when a data transmission channel is established, so in order to improve the security of data transmission, the service trusted program and the backup trusted program can also perform mutual authentication, and after the authentication is passed, a secure trusted channel for transmitting the data to be transmitted is established.
The verification of the service trusted program by the backup trusted program may be to verify whether the service trusted program is a trusted program, that is, whether the service trusted program is in a trusted execution environment.
In an optional embodiment, the verifying the service trusted program includes: and carrying out trusted execution environment verification on the service trusted program.
For example, the existing remote authentication mechanism (e.g., a remote authentication mechanism based on SGX technology) may be used to authenticate the trusted execution environment of the service trusted program. If the verification of the trusted execution environment of the service trusted program passes, the verification of the service trusted program is considered to pass; and if the verification of the trusted execution environment verification of the service trusted program is not passed, the verification of the service trusted program is considered to be not passed.
In order to facilitate the subsequent associated backup of the backup data and the service trusted program, the fingerprint information of the service trusted program carried in the verification result can be acquired after the trusted execution environment of the service trusted program is verified.
S520, after the verification is passed and the business trusted program passes the verification of the backup trusted program, a safe trusted channel between the business trusted program and the backup trusted program is established.
For example, during the process of verifying the business trusted program by the backup trusted program, the business trusted program may also verify the backup trusted program. And only after the two parties pass the verification, a safe and trusted channel between the business trusted program and the backup trusted program is established.
It should be noted that, in this embodiment, the order of the verification between the verification of the service trusted program and the verification of the backup trusted program on the service trusted program is not limited. The business trusted program can verify the backup trusted program before the business trusted program verifies the business trusted program; or the backup trusted program verifies the service trusted program before the service trusted program verifies the backup trusted program; or the verification of the backup trusted program and the business trusted program can be carried out simultaneously or alternately. The verification of the service trusted program on the backup trusted program may be referred to in the description of the foregoing embodiments, and is not described herein again.
S530, obtaining a sealed data plaintext through the secure trusted channel.
The secure trusted channel may be a channel only used for secure data transmission between the backup trusted program and the service trusted program. The data transmitted in the secure trusted channel cannot be known by third parties other than the business trusted program and the backup trusted program.
Illustratively, the service trusted program can send sealed data plaintext to the backup trusted program through the secure trusted channel; correspondingly, the backup trusted program obtains the sealed data plaintext from the secure trusted channel.
And S540, the sealed data plaintext and the service trusted program are associated, encrypted and backed up in the local TEE.
For example, the backup trusted program may associate the sealed data plaintext with the identification information of the service trusted program to encrypt the backup in the local TEE.
In order to facilitate the subsequent backup trusted program to search and acquire the backup result corresponding to the service credibility degree from the backed-up data, the fingerprint information of the service trusted program and the sealed data plaintext can be subjected to associated encryption backup through the fingerprint information of the service trusted program acquired from the verification result of the service trusted program.
In an optional embodiment, the associating the sealed data plaintext with the service trusted program in the local TEE for encrypted backup comprises: and (4) carrying out related encryption backup on the sealed data plaintext and the fingerprint information of the service trusted program in the local TEE.
For example, the result of the verification of the business trusted program by the backup trusted program may carry fingerprint information of the business trusted program. Therefore, the mode of the backup trusted program for encrypting and backing up the obtained sealed data plaintext in a correlated manner can be to bind the sealed data plaintext with the fingerprint information of the service trusted program to obtain binding information, and to backup and encrypt and store the binding information in the local TEE.
According to the optional embodiment, the fingerprint information of the service trusted program is acquired from the verification result of the service trusted program, and the fingerprint information of the service trusted program and the sealed data plaintext are bound and stored, so that the situation that other trusted programs steal data from the backup trusted program is avoided, and the data security in the backup trusted program is ensured.
The embodiment of the disclosure verifies the service trusted program, establishes the safe trusted channel between the service trusted program and the backup trusted program after the verification passes and the service trusted program verifies the backup trusted program, and obtains the sealed data plaintext through the safe trusted channel, thereby realizing mutual verification of the service trusted program and the backup trusted program and safe transmission of the sealed data plaintext. The situation that data are stolen by pretending the backup trusted program due to the non-backup trusted program or the backup trusted program of non-hardware coding is avoided, and the safety of data transmission from the service trusted program to the backup trusted program is ensured. Meanwhile, data transmission is carried out between the service trusted program and the backup trusted program through the safe trusted channel, introduction of a third party is reduced, and the data transmission process is more convenient and faster.
In one embodiment, an interaction flow diagram of a method for backing up data stored within a TEE is shown in fig. 5B.
S5101, the business trusted program of the business machine A obtains the backup request.
Wherein, the backup request can be initiated by the backup demanding party according to the actual demand. The backup request comprises identification information of a backup trusted program in the backup machine.
And S5102, verifying the backup trusted program of the backup machine X.
For example, the service machine a may perform trusted execution environment verification and fingerprint information verification on the backup trusted program of the backup machine X.
And S5103, the backup trusted program of the backup machine X verifies the business trusted program of the business machine A.
And S5104, after the verification of the two parties is passed, a secure trusted channel is established.
Illustratively, after the verification of the backup trusted execution environment of the backup machine X by the service machine a and the verification of the service trusted execution environment of the service machine a by the backup machine X are both passed, a secure trusted channel is established.
S5105, the service trusted program of the service machine A decrypts the sealed data ciphertext in the local TEE based on the hard coding key thereof to obtain a sealed data plaintext.
And S5106, transmitting the sealed data plaintext to the backup machine X through the secure trusted channel.
S5107, the backup trusted program of the backup machine X encrypts and backs up the sealed data plaintext to a local TEE based on a hard coding key of the backup trusted program.
For example, the backup machine X may encrypt and backup the data to be transmitted and the service trusted program in association in the local TEE. Specifically, the backup machine X may obtain the fingerprint information of the service trusted program from the verification result of the service trusted program, and perform associated encryption backup on the data to be transmitted and the fingerprint information of the service trusted program.
On the basis of the above technical solutions, the present disclosure also provides an optional embodiment, where in this embodiment, an operation of "generating an asymmetric key including a backup transmission private key and a backup transmission public key, and associating the backup transmission public key with its own identification information and storing uplink" is added before the operation of "obtaining data to be transmitted". Correspondingly, the step of obtaining the data to be transmitted is refined into the step of obtaining the data to be transmitted from the block chain according to the identification information of the user; the data to be transmitted comprises a backup transmission ciphertext of the sealed data; and the service trusted program encrypts and generates the sealed data plaintext obtained by decrypting the original ciphertext in the local TEE based on the backup transmission public key of the backup trusted program acquired from the identification information chain of the backup trusted program. Correspondingly, the operation of determining the sealed data plaintext according to the data to be transmitted is refined into the operation of decrypting the backup transmission ciphertext according to the backup transmission private key to obtain the sealed data plaintext so as to perfect the data transmission mechanism based on the block chain. It should be noted that, for parts not described in detail in the embodiments of the present disclosure, reference may be made to related expressions in other embodiments, and details are not described herein again.
Referring to fig. 6A, a method for backing up data stored in a TEE is performed by a backup trusted program of a backup machine, and includes:
s610, generating an asymmetric secret key comprising a backup transmission private key and a backup transmission public key, and associating and uplink storing the backup transmission public key and the self identification information.
The backup trusted program can generate asymmetric keys for encrypting and decrypting data, including a backup transmission private key and a backup transmission public key. The backup trusted program stores the backup transmission public key and the identification information of the backup transmission public key in a block chain in an associated manner; and locally storing and using the backup transmission private key. Correspondingly, the service trusted program can obtain the backup transmission public key uniquely corresponding to the backup trusted program on the chain through the identification information of the backup trusted program for encryption.
It can be understood that, in order to improve the security of data transmission and data backup, two-way authentication can be performed between the business trusted program and the backup trusted program, and data transmission and backup are performed after the authentication is passed. Therefore, the backup trusted program can store the relevant data for verification in association with the chain.
In an optional embodiment, associating the backup transmission public key with the self-id information and storing the backup transmission public key in uplink includes: generating remote verification information of the backup trusted program; and associating and chaining the backup transmission public key, the remote verification information of the backup trusted program and the identification information of the backup trusted program for storage, so that the business trusted program obtains the remote verification information of the backup trusted program on the chain according to the identification information of the backup trusted program, and verifies the backup trusted program according to the remote verification information of the backup trusted program.
Illustratively, the service trusted program may obtain, from the block chain, remote verification information of the backup trusted program corresponding to the identification information, according to the identification information of the backup trusted program; the service trusted program can perform trusted execution environment verification on the remote verification information of the backup trusted program through the existing remote verification technology.
For example, the backup trusted program may store the backup transmission public key, the remote authentication information, and the identification information of itself in association with the uplink. The identification information of the backup trusted program and the backup transmission public key have a corresponding relation with the remote verification information, and the service trusted program can acquire the corresponding backup transmission public key and the remote verification information through the identification information of the backup trusted program.
Optionally, the remote verification information of the backup trusted program may be generated based on hash data of the backup transmission public key. Therefore, the remote verification information obtained from the service trusted program chain may carry hash data of the backup transmission public key. The hash data of the backup transmission public key may be encrypted data obtained by hashing the backup transmission public key through a preset hash algorithm.
Correspondingly, in order to further improve the verification accuracy of the backup trusted program, the service trusted program can perform accuracy verification on the backup trusted program according to the remote verification information and the backup transmission public key acquired on the chain. The verification of the backup trusted program may include an accuracy verification of a backup transmission public key of the backup trusted program and an accuracy verification of a program fingerprint of the backup trusted program.
For example, the verification manner of the backup transmission public key of the backup trusted program by the service trusted program may be to verify the backup transmission public key according to hash data of the backup transmission public key in the remote verification information of the backup trusted program.
Specifically, the service trusted program may perform hash calculation on the backup transmission public key acquired from the link to obtain first hash data of the backup transmission public key; taking the hash data of the backup transmission public key in the remote verification information acquired from the link as second hash data; the business credible program carries out consistency comparison on the first hash data and the second hash data, and if the comparison result is consistent, the verification of the backup transmission public key of the backup credible program is considered to be passed; and if the comparison result is inconsistent, the verification of the backup transmission public key of the backup trusted program is not passed.
For example, the verification manner of the program fingerprint of the backup trusted program by the service trusted program may be to perform program fingerprint verification on the backup trusted program according to consistency between the fingerprint information of the backup trusted program in the remote verification information of the backup trusted program and the fingerprint information of the hard-coded backup trusted program in the service trusted program.
Specifically, the service trusted program acquires fingerprint information of the backup trusted program from the acquired remote verification information of the backup trusted program, and performs consistency comparison with the fingerprint information of the backup trusted program hard-coded by the service trusted program; if the comparison result is consistent, the program fingerprint of the backup trusted program is considered to pass the verification; and if the comparison result is inconsistent, the program fingerprint of the backup trusted program is not verified.
In the optional embodiment, the remote verification information of the backup trusted program is generated according to the hash data of the backup transmission public key; and associating and chaining the backup transmission public key, the remote verification information of the backup trusted program and the identification information of the backup trusted program for storage so that the service trusted program verifies the backup trusted program according to the backup transmission public key and the remote verification information acquired from the chain. According to the scheme, the mode that the backup trusted program stores the backup transmission public key and the remote verification information in a linked manner is adopted, so that the safety verification of the backup trusted program by the service trusted program according to the linked storage data is realized, and the condition of data safety hidden danger caused by the fact that a third party maliciously pretends to be the backup trusted program and carries out uplink storage on the related information is avoided.
S620, acquiring data to be transmitted from the block chain according to the identification information of the block chain; the data to be transmitted comprises a backup transmission ciphertext of the sealed data; and the backup transmission ciphertext is generated by encrypting the sealed data plaintext obtained by decrypting the original ciphertext in the local TEE by the service trusted program based on the backup transmission public key of the backup trusted program acquired from the identification information chain of the backup trusted program.
Illustratively, the service trusted program can decrypt an original ciphertext of the sealed data in the local TEE through a CPU hardware encryption key to obtain a sealed data plaintext; and encrypting the sealed data plaintext by using a backup transmission public key acquired on the basis of the identification information chain of the backup trusted program to obtain a backup transmission ciphertext, and associating and chaining the data to be transmitted including the backup transmission ciphertext and the identification information of the backup trusted program for storage.
For example, the backup trusted program may obtain the data to be transmitted corresponding to the self identification information from the chain through the self identification information.
And S630, decrypting the backup transmission ciphertext according to the backup transmission private key to obtain a sealed data plaintext.
Illustratively, the backup trusted program decrypts the backup transmission ciphertext through a backup transmission private key of the backup trusted program to obtain a sealed data plaintext. The backup transmission private key of the backup trusted program corresponds to the backup transmission public key and is used for encrypting and/or decrypting data.
It can be understood that, in order to improve the security of data transmission and data backup, bidirectional authentication can be performed between the business trusted program and the backup trusted program, and data transmission and backup are performed after the authentication is passed. Therefore, the business trusted program can uplink and store the related data for the backup trusted program to perform the security verification, so that the backup trusted program can verify the business trusted program through the related data for the security verification.
In an optional embodiment, the data to be transmitted may include remote verification information of the service trusted program generated based on the hash data of the backup transmission ciphertext; before decrypting the backup transmission ciphertext according to the backup transmission private key to obtain the sealed data plaintext, the backup trusted program can verify the backup transmission ciphertext according to the remote verification information of the service trusted program.
Illustratively, the service trusted program may carry hash data of the backup transmission ciphertext, and generate the remote verification information of the service trusted program based on an existing remote verification information generation manner. The business trusted program can generate data to be transmitted, wherein the data to be transmitted comprises the backup transmission ciphertext and the remote verification information of the business trusted program, and the data to be transmitted is linked and stored with the identification information of the backup trusted program.
The backup trusted program can acquire the data to be transmitted corresponding to the identification information of the backup trusted program from the chain according to the identification information of the backup trusted program; and acquiring remote verification information of the backup transmission ciphertext and the service trusted program from the data to be transmitted, and verifying the backup transmission ciphertext according to the remote verification information. Specifically, the trusted execution environment verification may be performed on the remote verification information by using an existing remote verification method. If the verification is passed, the backup trusted program can be considered to pass the verification of the backup transmission ciphertext; if the verification fails, the backup trusted program can be considered to fail to verify the backup transmission ciphertext.
According to the optional embodiment, the backup transmission ciphertext is verified according to the remote verification information of the business trusted program, so that the backup trusted program can verify the business trusted program, the bidirectional verification between the backup trusted program and the business trusted program is realized, the data security is improved, and the backup transmission ciphertext is prevented from being maliciously tampered by a third party.
In order to further improve the verification accuracy of the backup trusted program on the backup transmission ciphertext and improve the security of the backup transmission ciphertext, the accuracy of the backup transmission ciphertext can be verified in a manner of obtaining hash data of the backup transmission ciphertext.
In an optional embodiment, the verifying the backup transmission ciphertext according to the remote verification information of the service trusted program includes: and verifying the backup transmission ciphertext according to the matching condition of the backup transmission ciphertext and the hash data of the backup transmission ciphertext carried in the remote verification information of the service trusted program.
For example, the backup trusted program may perform hash calculation on the backup transmission ciphertext acquired from the chain to obtain first hash data of the backup transmission ciphertext; taking the hash data of the backup transmission ciphertext in the remote verification information acquired from the chain as second hash data; the backup trusted program carries out consistency matching on the first hash data and the second hash data, and if the matching result is consistent, the accuracy verification of the backup transmission ciphertext is passed; and if the matching results are inconsistent, the accuracy verification of the backup transmission ciphertext is not passed.
According to the optional embodiment, the backup transmission ciphertext is verified according to the matching condition of the backup transmission ciphertext and the hash data of the backup transmission ciphertext carried in the remote verification information of the service trusted program, so that the verification accuracy of the backup transmission ciphertext is improved, and the safety of the backup transmission ciphertext is improved.
And S640, the sealed data plaintext and the service trusted program are related, encrypted and backed up in the local TEE.
According to the scheme of the embodiment of the disclosure, the uplink storage of the relevant data for verification is realized by generating the asymmetric key comprising the backup transmission private key and the backup transmission public key and associating the backup transmission public key and the identification information of the backup transmission public key with the uplink storage. And acquiring the data to be transmitted from the block chain according to the identification information of the block chain, and decrypting the backup transmission ciphertext according to the backup transmission private key to obtain the sealed data plaintext. According to the scheme, the block chain is introduced, and the data to be transmitted are stored in the block chain, so that the condition that the backup machine is damaged to cause data loss is prevented. And the data is stored on the block chain, so that the safety of the data is improved.
In one embodiment, an interaction flow diagram of a method for backing up data stored within a TEE is shown in fig. 6B.
S6101, the backup trusted program of the backup computer X generates an asymmetric key including a backup transmission private key and a backup transmission public key.
S6102, generate the remote verification information according to the hash data of the backup transmission public key.
S6103, uplink storing the backup transmission public key and the remote authentication information.
S6104, the service trusted program of the service machine a obtains the backup request.
The backup request comprises identification information of a backup trusted program in the backup machine X.
S6105, obtaining the backup transmission public key of the backup trusted program and the remote verification information from the block chain.
For example, the service machine a may obtain the backup transmission public key of the backup trusted program from the block chain according to the identification information of the backup trusted program of the backup machine X.
S6106, according to the hard coding key, decrypting the sealed data cipher text in the local TEE to obtain the sealed data plaintext.
S6107, encrypting the sealed data plaintext according to the backup transmission public key to obtain the backup transmission ciphertext.
S6108, generate remote verification information based on the hash data of the backup transmission ciphertext.
S6109, generating the data to be transmitted including the backup transmission cryptograph and the remote verification information.
S6110, the service machine A verifies the backup trusted program of the backup machine X according to the remote verification information and the backup transmission public key.
S6111, according to the hash data of the backup transmission public key in the remote verification information, the public key verification is carried out on the backup transmission public key; and program fingerprint verification is carried out on the backup trusted program according to the consistency of the fingerprint information of the backup trusted program in the remote verification information and the hard-coded fingerprint information in the service trusted program.
S6112, after the backup trusted program is verified, the data to be transmitted is uplink-stored.
For example, the service machine a may associate the data to be transmitted and the identification information of the backup trusted program to be uplink-stored.
S6113, the backup trusted program of the backup machine X acquires the data to be transmitted from the chain.
For example, the backup machine X may obtain data to be transmitted from the block chain according to its own identification information.
S6114, according to the hash data of the backup transmission ciphertext of the remote verification information in the data to be transmitted, verifying the backup transmission ciphertext.
For example, the to-be-transmitted data may carry remote verification information of a service trusted program generated by the service machine a according to the hash data of the backup transmission ciphertext. The backup machine X can verify the backup transmission ciphertext according to the matching condition of the backup transmission ciphertext and the hash data of the backup transmission ciphertext carried in the remote verification information of the service trusted program.
S6115, after the verification of the backup transmission ciphertext passes, decrypting the backup transmission ciphertext according to the backup transmission private key to obtain a sealed data plaintext.
S6116, encrypting the sealed data plaintext based on the local hard coding key, and associating, encrypting and backing up the encryption result and the fingerprint information carried by the remote verification information in the data to be transmitted to the local TEE.
On the basis of the above technical solutions, the embodiment of the present disclosure further provides a method for restoring data stored in the TEE, which is used to restore backed-up data in the backup machine to a restoring machine that replaces the service machine.
The method and the device for recovering the data stored in the TEEs are suitable for an application scene of data recovery after backup of the data stored in the trusted execution environment. The method for restoring the data stored in each TEE provided by the embodiment of the present disclosure may be executed by a device for restoring the data stored in the TEE, where the device may be implemented by software and/or hardware, and is specifically configured in an electronic device, and the electronic device may be a restoring machine.
For ease of understanding, the method of restoring stored data within a TEE provided by the present disclosure is first described in detail.
Referring to fig. 7, a method for recovering data stored in a TEE is executed by a service trusted program of a recovery machine, and includes:
s710, acquiring a recovery request; the recovery request includes identification information of a backup trusted program in the backup machine.
The restore request may be a request for restoring backup data in the backup machine. The recovery request may be initiated by a recovery-requiring party. The restore machine may be a server for receiving and storing backup data to be restored, with a trusted execution environment deployed within the restore machine. The backup data from the restore in the restore machine may be saved in the TEE and there is no possibility of leakage.
Wherein the recovery request can be obtained by a service trusted program of the recovery machine. The business trusted program may be an application deployed within the recovery machine for performing recovery requests. It should be noted that, the service trusted program in the recovery machine is the same application program as the service trusted program of the service machine corresponding to the backup program that needs to be recovered. I.e. two copies of the same service trusted program launched on the service machine and the recovery machine. In addition, the same service trusted programs deployed on the service machine and the recovery machine have the same fingerprint information.
The identification information of the backup trusted program is used for uniquely representing the identity information of the backup trusted program. For example, the identification information may be a program identification of the backup trusted program, and program identifications of different backup trusted programs in the same backup machine are different, and a unique backup trusted program can be located through the program identification.
Optionally, the identification information may also be address information of the backup trusted program. For example, the address information may include a backup machine address and a program identifier of a backup trusted program. The backup machine address is used for positioning the backup machine, and the program identification is used for positioning the only backup trusted program under the backup machine.
For example, the recovery demander may send a recovery request for the backup data to the recovery machine according to an actual recovery requirement for the backup data, and obtain the recovery request by a service trusted program of the recovery machine. The recovery request includes identification information of a backup trusted program in the backup machine.
In order to facilitate the recovery of the backup data of different versions, optionally, a version identifier may be further added in the recovery request, and during the data recovery, the data recovery may be performed on the specified version. Wherein the version identification may be specified by the recovery demander.
Optionally, when the types of the backup data are many, a timestamp, an information identifier, and the like may also be added in the recovery request, so that the backup data is located and recovered through the timestamp or the information identifier in the process of recovering the backup data.
S720, acquiring self-associated data to be transmitted from the backup trusted program according to the identification information of the backup trusted program, and determining a corresponding sealed data plaintext according to the data to be transmitted.
The data to be transmitted may be backup data transmitted from a backup trusted program of the backup machine to a service trusted program of the recovery machine. For example, the backup trusted program of the backup machine may obtain, according to the obtained identification information of the backup trusted program, data to be transmitted corresponding to the identification information from the backup trusted program.
The data to be transmitted may include a sealed data plaintext, or the data to be transmitted may include a ciphertext obtained by encrypting the sealed data plaintext based on a preset encryption algorithm.
Illustratively, if the data to be transmitted comprises a sealed data plaintext, the sealed data plaintext is directly obtained from the data to be transmitted; and if the data to be transmitted comprises an encryption result of the sealed data plaintext based on the preset encryption algorithm, decrypting the encryption result based on the preset decryption algorithm corresponding to the preset encryption algorithm to obtain the sealed data plaintext.
And S730, encrypting and storing the sealed data in the local TEE in a plain text mode.
The local TEE is a TEE deployed inside a service trusted program of the recovery machine.
For example, the service trusted program of the recovery machine may encrypt and backup the sealed data plaintext in the local TEE. Specifically, the service trusted program of the recovery machine encrypts the sealed data plaintext based on the hard-coded key of the service trusted program to obtain a sealed data ciphertext, and stores the sealed data ciphertext in the local TEE.
Optionally, the sealed data plaintext may be encrypted and backed up in a disk of a local TEE of the recovery machine, so as to implement persistent storage of the data.
According to the scheme of the embodiment of the disclosure, the self-associated data to be transmitted is acquired from the backup trusted program according to the identification information of the backup trusted program in the acquired recovery request, and the plaintext of the corresponding sealed data is determined according to the data to be transmitted; the sealed data is stored in the local TEE in a plain text encryption mode, the sealed data inside the TEE of the backup machine is recovered and stored, and reliable sealed data recovery guarantee is provided when the sealed data is lost due to failure or damage of the business machine.
On the basis of the technical schemes, the disclosure also provides an optional embodiment, in which the data to be transmitted is a sealed data plaintext; correspondingly, the operation of acquiring self-associated data to be transmitted from the backup trusted program according to the identification information of the backup trusted program and determining corresponding sealed data plaintext according to the data to be transmitted is further refined into the operation of verifying the backup trusted program; after the verification is passed and the backup trusted program passes the verification of the business trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program; and acquiring self-associated sealed data plaintext' from the backup trusted program through the secure trusted channel so as to perfect a data transmission mechanism based on the secure trusted channel. It should be noted that, for parts not described in detail in the embodiments of the present disclosure, reference may be made to related expressions in other embodiments, and details are not described herein again.
Referring to fig. 8, a method for recovering data stored in a TEE is executed by a service trusted program of a recovery machine, and includes:
s810, acquiring a recovery request; the recovery request includes identification information of a backup trusted program in the backup machine.
And S820, verifying the backup trusted program.
The verification of the backup trusted program may be to verify whether the backup trusted program is a trusted program, that is, whether the backup trusted program is in the trusted execution environment. For example, an existing remote authentication mechanism (e.g., SGX-based remote authentication technology) may be employed to authenticate whether the backup trusted program is a trusted program.
In order to further improve the safety of the backup trusted program, the correctness of the backup trusted program can be verified.
In an optional embodiment, fingerprint information of the backup trusted program is hard-coded in the service trusted program; verifying the backup trusted program, comprising: verifying the trusted execution environment of the backup trusted program; and if the verification is passed, performing program fingerprint verification on the backup trusted program according to the consistency of the fingerprint information of the backup trusted program carried in the verification result and the hard-coded fingerprint information in the service trusted program.
It can be understood that, in order to avoid an error of the backup trusted program for performing data recovery, the service trusted program may have fingerprint information of the backup trusted program hard-coded in advance. The fingerprint information may be a digest hash of the backup trusted program.
If the trusted execution environment of the backup trusted program passes verification, further performing fingerprint verification on the backup trusted program according to the verification result carrying the fingerprint information of the backup trusted program; if the verification of the trusted execution environment of the backup trusted program is not passed, fingerprint verification of the backup trusted program is not required, so that the waste of computing resources is reduced.
For example, if the trusted execution environment of the backup trusted program passes the verification, fingerprint information of the backup trusted program is obtained from the verification result. The service trusted program can compare the information consistency of the fingerprint information acquired from the verification result with the fingerprint information of the hard-coded backup trusted program stored in the service trusted program; if the fingerprint information is consistent, the program fingerprint verification of the backup trusted program is considered to be passed, namely the backup trusted program is consistent with the backup trusted program required by the service trusted program, and the verification of the backup trusted program is indicated to be passed; if the fingerprint information is inconsistent, the program fingerprint verification of the backup trusted program is not passed, that is, the backup trusted program is inconsistent with the backup trusted program required by the service trusted program, and the verification of the backup trusted program is not passed at this moment.
According to the scheme of the optional embodiment, the backup trusted program is subjected to trusted execution environment verification, and program fingerprint verification is performed on the backup trusted program according to the fingerprint information of the backup trusted program carried in the verification result, so that the comprehensiveness of the verification on the backup trusted program is realized, the verification accuracy of the backup trusted program is further improved, and the situation of data safety hidden trouble caused by malicious spoofing of the backup trusted program by a third party is avoided.
And S830, after the verification is passed and the backup trusted program passes the verification of the business trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program.
The verification of the service trusted program by the backup trusted program may include the verification of a trusted execution environment of the service trusted program, and may specifically be implemented by using an existing trusted execution environment verification technology, for example, an SGX-based remote verification technology.
Illustratively, in the process of verifying the backup trusted program by the service trusted program, the backup trusted program verifies the trusted execution environment of the service trusted program; and after the backup trusted program passes the verification of the service trusted program, establishing a safe trusted channel between the service trusted program and the backup trusted program.
It should be noted that, in the embodiment, the order of the verification between the verification of the service trusted program and the verification of the service trusted program by the backup trusted program is not limited. The business trusted program verifies the backup trusted program first, and the backup trusted program verifies the business trusted program later; or the backup trusted program verifies the service trusted program before the service trusted program verifies the backup trusted program; or the verification of the backup trusted program and the business trusted program can be carried out simultaneously or alternately.
And S840, acquiring self-associated sealed data plaintext from the backup trusted program through the secure trusted channel.
The secure trusted channel may be a channel only used for secure data transmission between the backup trusted program and the service trusted program. The data transmitted in the secure trusted channel cannot be known by third parties other than the business trusted program and the backup trusted program.
Illustratively, the service trusted program of the recovery machine may obtain the sealed data plaintext corresponding to the identification information of the service trusted program from the backup trusted program through the secure trusted channel.
And S850, encrypting and storing the sealed data in the local TEE in a plain text mode.
The scheme of the embodiment of the disclosure verifies the backup trusted program; and after the verification is passed and the backup trusted program passes the verification of the service trusted program, establishing a safe trusted channel between the service trusted program and the backup trusted program, so that mutual verification of the service trusted program and the backup trusted program is realized, the situation that the backup trusted program is not a backup trusted program or a backup trusted program encoded by hardware steals data by pretending to be the backup trusted program is avoided, and the safety of data transmission from the service trusted program to the backup trusted program is ensured. Meanwhile, data transmission is carried out between the service trusted program and the backup trusted program through the safe trusted channel, introduction of a third party is reduced, and the data transmission process is more convenient and faster.
On the basis of the above technical solutions, the present disclosure also provides an optional embodiment, where before "obtaining data to be transmitted associated with itself from a backup trusted program according to identification information of the backup trusted program", an "asymmetric key including a transmission recovery private key and a transmission recovery public key is generated" and the transmission recovery public key and the identification information of itself are associated and stored "is added; correspondingly, the operation of ' acquiring self-associated data to be transmitted from the backup trusted program according to the identification information of the backup trusted program and determining corresponding sealed data plaintext according to the data to be transmitted ' is further refined into ' sending the recovery request to a block chain so that the backup trusted program responds to the recovery request, acquiring a recovery transmission public key on the chain, generating the data to be transmitted including a recovery transmission ciphertext, and storing the data to be transmitted and the identification information of the service trusted program in a chain associated with each other; the recovery transmission ciphertext is obtained by encrypting a decryption result of a sealed data ciphertext related to the service trusted program by the backup trusted program based on the recovery transmission public key; and acquiring the data to be transmitted on the chain according to the identification information of the chain, and decrypting the recovered transmission ciphertext according to the recovered transmission private key to obtain a sealed data plaintext so as to perfect a data transmission mechanism based on the block chain. It should be noted that, for parts not described in detail in the embodiments of the present disclosure, reference may be made to related expressions in other embodiments, and details are not described herein again.
Referring to fig. 9, a method for standby recovery of stored data in a TEE is executed by a service trusted program of a recovery machine, and includes:
s910, acquiring a recovery request; the recovery request includes identification information of a backup trusted program in the backup machine.
S920, generating an asymmetric key comprising a recovery transmission private key and a recovery transmission public key, and associating and uplink storing the recovery transmission public key and the self identification information.
The service trusted program of the recovery machine may generate asymmetric keys for encrypting and decrypting data, including recovering the private transmission key and recovering the public transmission key. The service credible program of the recovery machine stores the recovery transmission public key and the identification information of the recovery transmission public key in a block chain in an associated manner; the local retention use of the transmission private key is restored. Correspondingly, the backup trusted program can obtain the recovery transmission public key uniquely corresponding to the service trusted program on the chain through the identification information of the service trusted program for encryption.
It can be understood that, in order to improve the security of data transmission and data backup, bidirectional authentication can be performed between the business trusted program of the recovery machine and the backup trusted program of the backup machine, and data transmission and recovery are performed after the authentication is passed. Therefore, the service trusted program can perform associated uplink storage on the related data for verification.
In an optional embodiment, associating the recovered transmission public key with the self-identification information and uplink storing, includes: generating remote verification information of the service trusted program; and linking and storing the recovered transmission public key and the remote verification information of the service trusted program and the identification information of the backup trusted program in an associated manner, so that the backup trusted program obtains the remote verification information of the service trusted program in a link according to the identification information of the service trusted program and verifies the service trusted program according to the remote verification information of the service trusted program.
For example, the backup trusted program may obtain, from the block chain, remote verification information of the service trusted program corresponding to the identification information according to the identification information of the service trusted program; the backup trusted program can perform trusted execution environment verification on the remote verification information of the service trusted program through the existing remote verification technology.
For example, the service trusted program of the recovery machine may associate and store the recovery transmission public key, the remote authentication information, and the identification information of the recovery machine itself. The identification information of the service trusted program and the recovery transmission public key have a corresponding relationship with the remote verification information, and the backup trusted program can acquire the corresponding recovery transmission public key and the remote verification information through the identification information of the service trusted program.
For example, the remote verification information of the service trusted program can be generated based on the hash data of the recovered transmission public key. Therefore, the remote verification information acquired from the backup trusted program chain may carry hash data for recovering the transmission public key. The hash data of the recovered transmission public key may be encrypted data obtained by hashing the recovered transmission public key through a preset hash algorithm. Correspondingly, in order to further improve the verification accuracy of the service trusted program, the backup trusted program can perform accuracy verification on the service trusted program according to the remote verification information and the recovery transmission public key acquired on the chain. The verification mode of the backup trusted program for the recovery transmission public key of the business trusted program can be to verify the accuracy of the recovery transmission public key according to the hash data of the recovery transmission public key in the remote verification information of the business trusted program.
Specifically, the backup trusted program may perform hash calculation on the recovery transmission public key acquired from the link to obtain first hash data of the recovery transmission public key; taking the hash data of the recovery transmission public key in the remote verification information acquired from the chain as second hash data; the backup trusted program compares the consistency of the first hash data and the second hash data, and if the comparison result is consistent, the verification of the recovery transmission public key of the service trusted program is considered to pass; and if the comparison result is inconsistent, the verification of the recovery transmission public key of the service trusted program is not passed.
In the optional embodiment, the remote verification information of the service trusted program is generated according to the hash data of the recovery transmission public key; and associating and chaining the recovery transmission public key and the remote verification information of the service trusted program and the identification information of the backup trusted program to store so that the backup trusted program verifies the service trusted program according to the recovery transmission public key and the remote verification information acquired from the chain. According to the scheme, the mode that the service trusted program is linked, stored, restored and transmitted the public key and the remote verification information is adopted, the backup trusted program can verify the safety of the service trusted program according to the linked and stored data, and the situation that a third party maliciously pretends to the service trusted program and carries out uplink storage on the related information to bring about data safety hidden trouble is avoided.
S930, sending a recovery request to the block chain so that the backup trusted program can respond to the recovery request, obtain a recovery transmission public key on the chain, generate to-be-transmitted data including a recovery transmission ciphertext, and store the to-be-transmitted data and the identification information of the service trusted program in a link association manner; and the recovery transmission ciphertext is obtained by encrypting the decryption result of the sealed data ciphertext related to the service trusted program by the backup trusted program based on the recovery transmission public key.
The service trusted program of the recovery machine can inform the backup trusted program of acquiring the data to be transmitted by sending a recovery request to the block chain. Correspondingly, the backup trusted program can acquire the recovery request in a polling mode chain and the like, and a recovery transmission public key is acquired from the blockchain in response to the recovery request; and the backup trusted program encrypts a decryption result of the sealed data ciphertext related to the service trusted program through the recovery transmission public key to obtain a recovery transmission ciphertext.
Specifically, the backup trusted program decrypts the sealed data ciphertext in the local TEE through the own CPU hardware encryption key to obtain the sealed data plaintext. And encrypting the sealed data plaintext through the recovery transmission public key to obtain a recovery transmission ciphertext.
And the backup trusted program associates and cochains the data to be transmitted including the recovery transmission ciphertext with the identification information of the service trusted program for storage, so that the service trusted program of the subsequent recovery machine can acquire the corresponding data to be transmitted through the identification information.
And S940, acquiring the data to be transmitted on the chain according to the identification information of the user, and decrypting the recovered transmission ciphertext according to the recovered transmission private key to obtain the sealed data plaintext.
Illustratively, the service trusted program recovers the transmission private key by recovering the transmission public key, and decrypts the recovered transmission ciphertext to obtain the recovered data plaintext.
It can be understood that, in order to improve the security of the data transmission and data recovery process, bidirectional authentication can be performed between the business trusted program and the backup trusted program, and data transmission and recovery are performed after the authentication is passed. Therefore, the backup trusted program can perform uplink storage on the related data for performing the security verification on the business trusted program, so that the business trusted program can conveniently verify the backup trusted program through the related data for performing the security verification.
In an optional embodiment, the data to be transmitted further includes remote verification information of the backup trusted program generated based on the hash data of the recovered transmission ciphertext; before decrypting the recovery transmission ciphertext according to the recovery transmission private key to obtain the sealed data plaintext, the service trusted program in the recovery machine verifies the recovery transmission ciphertext according to the remote verification information of the backup trusted program.
Illustratively, the backup trusted program may carry hash data for recovering the transmission ciphertext, and generate the remote verification information of the backup trusted program based on an existing remote verification information generation manner. The backup trusted program can generate data to be transmitted, wherein the data to be transmitted comprises the recovery transmission ciphertext and the remote verification information of the backup trusted program, and the data to be transmitted is linked and stored with the identification information of the business trusted program.
The service trusted program can acquire data to be transmitted corresponding to the identification information of the service trusted program from the chain according to the identification information of the service trusted program; and acquiring remote verification information of the recovery transmission ciphertext and the backup trusted program from the data to be transmitted, and verifying the recovery transmission ciphertext according to the remote verification information. Specifically, the trusted execution environment verification may be performed on the remote verification information by using an existing remote verification method. If the verification is passed, the service trusted program can be considered to pass the verification of the recovery transmission ciphertext; if the verification fails, the service trusted program can be considered to fail to verify the recovery transmission ciphertext.
According to the optional embodiment, the recovery transmission ciphertext is verified according to the remote verification information of the backup trusted program, so that the business trusted program can verify the backup trusted program, the two-way verification between the business trusted program and the backup trusted program is realized, the data security is improved, and the recovery transmission ciphertext is prevented from being maliciously tampered by a third party.
In order to further improve the verification accuracy of the service trusted program on the recovery transmission ciphertext and improve the safety of the recovery transmission ciphertext, the accuracy verification can be performed on the recovery transmission ciphertext by the acquired hash data of the recovery transmission ciphertext.
In an optional embodiment, the verifying the recovery transmission ciphertext according to the remote verification information of the backup trusted program includes: and verifying the recovered transmission ciphertext according to the matching condition of the recovered transmission ciphertext and the hash data of the recovered transmission ciphertext carried in the remote verification information of the backup trusted program.
For example, the service trusted program may perform hash calculation on the recovered transmission ciphertext obtained from the chain to obtain first hash data of the recovered transmission ciphertext; taking the hash data of the recovery transmission ciphertext in the remote verification information acquired from the chain as second hash data; the service trusted program carries out consistency matching on the first hash data and the second hash data, and if the matching result is consistent, the accuracy verification of the recovered transmission ciphertext is passed; and if the matching results are inconsistent, the verification of the accuracy of the recovered transmission ciphertext is not passed.
According to the optional embodiment, the recovery transmission ciphertext is verified according to the matching condition of the recovery transmission ciphertext and the hash data of the recovery transmission ciphertext carried in the remote verification information of the backup trusted program, so that the verification accuracy of the recovery transmission ciphertext is improved, and the safety of the recovery transmission ciphertext is improved.
In order to further improve the accuracy and the safety of the business trusted program for verifying the backup trusted program, the backup trusted program can be further verified through the fingerprint information of the backup trusted program.
In an optional embodiment, the verifying the recovery transmission ciphertext according to the remote verification information of the backup trusted program includes: and performing program fingerprint verification on the backup trusted program according to the consistency of the fingerprint information of the backup trusted program in the remote verification information of the backup trusted program and the hard-coded fingerprint information in the service trusted program.
It should be noted that the remote verification information of the backup trusted program carries fingerprint information of the backup trusted program itself; fingerprint information of the backup trusted program is hard-coded in the business trusted program in advance.
Illustratively, the service trusted program acquires fingerprint information of the backup trusted program from the acquired remote verification information of the backup trusted program, and performs consistency comparison with the fingerprint information of the backup trusted program hard-coded by the service trusted program; if the comparison result is consistent, the accuracy verification of the program fingerprint of the backup trusted program is passed; and if the comparison result is inconsistent, the accuracy verification of the program fingerprint of the backup trusted program is not passed.
In the optional embodiment, the program fingerprint verification is performed on the backup trusted program by comparing the fingerprint information of the backup trusted program in the remote verification information with the consistency of the hard-coded fingerprint information in the service trusted program, so that the accurate verification of the program fingerprint of the backup trusted program is realized, and the verification accuracy of the backup trusted program is further improved.
S950, encrypting and storing the sealed data in the local TEE in a plain text mode.
According to the scheme of the embodiment of the disclosure, the uplink storage of the related data for verification is realized by generating the asymmetric key comprising the recovered transmission private key and the recovered transmission public key and associating the recovered transmission public key with the identification information of the user. And sending the recovery request to the block chain, acquiring the data to be transmitted on the chain according to the identification information of the block chain, and decrypting the recovery transmission ciphertext according to the recovery transmission private key to obtain the sealed data plaintext. According to the scheme, the block chain is introduced, and the data to be transmitted are stored in the block chain, so that the condition that the backup machine is damaged to cause data loss is prevented. And the data is stored on the block chain, so that the safety of data recovery is improved.
The technical scheme takes the recovery machine of the substitute service machine as an execution main body and explains the recovery method of the data stored in the TEE. Hereinafter, a method for restoring data stored in the TEE will be described in detail, with the backup machine as the execution main body. It should be noted that, in the embodiment, reference may be made to related descriptions of other embodiments, which are not detailed.
Referring to fig. 10, a method for restoring data stored in a TEE is executed by a backup trusted program of a backup machine, and includes:
s1010, determining data to be transmitted associated with the service trusted program stored in the local TEE.
And the data to be transmitted is generated by a service trusted program in the service machine according to the original ciphertext of the sealed data in the local TEE, and is transmitted according to the identification information of the backup trusted program in the acquired backup request.
Wherein, the backup request can be obtained by a service trusted program of the service machine. The business trusted program may be an application deployed within the business machine for responding to backup requests. At least one business trusted program can be included in the business machine, and different business trusted programs can respond to backup requests initiated by different demanders.
The backup request comprises identification information of a backup trusted program in the backup machine. The backup machine can be a server for performing backup storage on the encrypted data in the business machine. The backup trusted program in the backup machine may be an application deployed within the backup machine for data recovery. The backup machine may include at least one backup trusted program, and different backup trusted programs may recover stored data corresponding to the same or different service credibility degrees. It should be noted that, the backup trusted program is the same as the backup trusted program in the data backup process.
The identification information of the backup trusted program is used for uniquely representing the identity information of the backup trusted program. For example, the identification information may be a program identifier of the backup trusted program, and program identifiers of different backup trusted programs in the same backup machine are different, and a unique backup trusted program may be accessed through the program identifiers.
Optionally, the identification information may also be address information of the backup trusted program. For example, the address information may include a backup machine address and a program identifier of a backup trusted program. The backup machine address is used for positioning the backup machine, and the program identification is used for positioning the only backup trusted program under the backup machine.
For example, the backup trusted program may determine, in the local TEE, the to-be-transmitted data corresponding to the identification information through the service trusted program identification information carried in the recovery request.
S1020, the data to be transmitted is sent to the service trusted program, so that the service trusted program determines the corresponding sealed data plaintext according to the data to be transmitted, and the sealed data plaintext is encrypted and stored in the local TEE.
A backup trusted program in the backup machine sends data to be transmitted to a service trusted program in the recovery machine; and the service trusted program determines the sealed data plaintext according to the data to be transmitted, and encrypts and stores the sealed data plaintext into a local TEE of the recovery machine.
If the data to be transmitted comprises the sealed data plaintext, the service trusted program can directly acquire the sealed data plaintext from the data to be transmitted; if the data to be transmitted comprises an encryption result obtained by encrypting the plaintext of the sealed data based on the preset encryption algorithm, the service trusted program can decrypt the encryption result based on the preset decryption algorithm to obtain the plaintext of the sealed data.
For example, the service trusted program of the recovery machine may encrypt the sealed data plaintext based on a hard-coded key of the service trusted program to obtain a sealed data ciphertext, and store the sealed data ciphertext in the local TEE.
Optionally, the service trusted program may encrypt and store the sealed data plaintext in the disk of the local TEE, so as to implement persistent storage of the data.
According to the technical scheme, the data to be transmitted associated with the service trusted program stored in the local TEE are determined, the data to be transmitted are sent to the service trusted program, so that the service trusted program determines the corresponding sealed data plaintext according to the data to be transmitted, and the sealed data plaintext is encrypted and stored in the local TEE, recovery and storage of the sealed data inside the TEE of the backup machine are achieved, and reliable sealed data recovery guarantee is provided when the sealed data are lost due to failure or damage of the service machine.
On the basis of the technical schemes, the disclosure also provides an optional embodiment, in which the data to be transmitted is a sealed data plaintext; correspondingly, before the operation of sending the data to be transmitted to the service trusted program, adding a verification function for the service trusted program; and after the verification is passed and the business trusted program passes the verification of the backup trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program. Correspondingly, the operation of sending the data to be transmitted to the service trusted program is further refined into the operation of transmitting sealed data plaintext to the service trusted program through the secure trusted channel so as to perfect a data transmission mechanism based on the secure trusted channel. It should be noted that, for parts not described in detail in the embodiments of the present disclosure, reference may be made to related expressions in other embodiments, and details are not described herein again.
Referring to fig. 11A, a method for restoring data stored in a TEE is performed by a backup trusted program of a backup machine, and includes:
s1110, determining to-be-transmitted data associated with the service trusted program stored in the local TEE.
And S1120, verifying the service trusted program.
It should be noted that a data transmission channel may be directly established between the service trusted program and the backup trusted program, and the data to be transmitted is sent to the backup trusted program through the established data transmission channel. However, the problem of data leakage exists when the data transmission channel is established in a trade, so in order to improve the security of data transmission, the service trusted program and the backup trusted program can also perform mutual authentication, and after the authentication is passed, a secure trusted channel for transmitting the data to be transmitted is established.
The verification of the service trusted program by the backup trusted program may be to verify whether the service trusted program is a trusted program, that is, whether the service trusted program is in a trusted execution environment.
In an optional embodiment, the verifying the service trusted program includes: and carrying out trusted execution environment verification on the service trusted program.
For example, the existing remote authentication mechanism (e.g., a remote authentication mechanism based on SGX technology) may be used to authenticate the trusted execution environment of the service trusted program. If the verification of the trusted execution environment of the service trusted program passes, the verification of the service trusted program is considered to pass; and if the verification of the trusted execution environment verification of the service trusted program is not passed, the verification of the service trusted program is considered to be not passed.
In order to facilitate subsequent searching and obtaining of associated data of the service trusted program from the backed-up data, fingerprint information of the service trusted program carried in a verification result can be obtained after the trusted execution environment of the service trusted program is verified.
S1130, after the verification is passed and the business trusted program passes the verification of the backup trusted program, a safe trusted channel between the business trusted program and the backup trusted program is established.
And the business trusted program can also verify the backup trusted program in the verification process of the backup trusted program on the business trusted program. And only after the two parties pass the verification, a safe and trusted channel between the service trusted program and the backup trusted program is established. For the verification of the backup trusted program by the service trusted program, reference may be made to the description of the foregoing embodiments, and details are not described herein again.
It should be noted that, in this embodiment, the order of the verification between the verification of the service trusted program and the verification of the backup trusted program on the service trusted program is not limited. The business trusted program can verify the backup trusted program before the business trusted program verifies the business trusted program; or the backup trusted program verifies the service trusted program before the service trusted program verifies the backup trusted program; or the verification of the backup trusted program and the business trusted program can be carried out simultaneously or alternately. The verification of the service trusted program on the backup trusted program may be performed in the related description of the foregoing embodiments, and is not described herein again.
And S1140, transmitting the sealed data plaintext to the service trusted program through the secure trusted channel, so that the service trusted program determines the corresponding sealed data plaintext according to the data to be transmitted, and encrypting and storing the sealed data plaintext into the local TEE.
The secure trusted channel may be a channel only used for secure data transmission between the backup trusted program and the service trusted program. The data transmitted in the secure trusted channel cannot be known by third parties other than the business trusted program and the backup trusted program.
Illustratively, the backup trusted program can send sealed data plaintext to the service trusted program through the secure trusted channel; and the service trusted program acquires the sealed data plaintext from the secure trusted channel. The service trusted program can encrypt and recover the sealed data plaintext in the local TEE.
Since the backup trusted program may store backup data of at least one service trusted program, corresponding backup data may be searched and obtained in the local TEE according to the fingerprint information carried in the verification result of the service trusted program, and data to be transmitted is generated according to the search result.
In an optional embodiment, determining to-be-transmitted data associated with a service trusted program stored in a local TEE comprises: and determining a sealed data plaintext associated with the service trusted program in the local TEE according to the fingerprint information of the service trusted program.
According to the optional embodiment, the fingerprint information of the service trusted program is acquired from the verification result of the service trusted program, and the fingerprint information of the service trusted program and the sealed data plaintext are bound and stored, so that the situation that other trusted programs steal data from the backup trusted program is avoided, and the data security in the backup trusted program is ensured. Meanwhile, the method can adapt to the situation that the backup trusted program simultaneously performs multi-service trusted program backup, and is convenient for performing targeted data recovery on different service trusted programs.
According to the scheme of the embodiment of the invention, the service trusted program is verified, the safe trusted channel between the service trusted program and the backup trusted program is established after the verification is passed and the service trusted program verifies the backup trusted program, and the sealed data plaintext is obtained through the safe trusted channel, so that mutual verification of the service trusted program and the backup trusted program is realized, and safe transmission of the sealed data plaintext is realized. The situation that the backup trusted program which is identified by the service trusted program steals data by impersonating the service trusted program due to the non-backup trusted program or the backup trusted program of the non-hardware code is avoided, and the safety of data transmission from the service trusted program to the backup trusted program is ensured.
In a specific embodiment, an interaction flow diagram of a method for restoring stored data within a TEE is shown in fig. 11B.
S1101, the service trusted program of the service machine B acquires a recovery request.
Wherein, the recovery request can be initiated by the recovery demander according to the actual demand.
And S1102, verifying the backup trusted program of the backup machine X.
For example, the business machine B may perform trusted execution environment verification and fingerprint information verification on the backup trusted program of the backup machine X.
S1103, the backup trusted program of the backup machine X verifies the business trusted program of the business machine B.
And S1104, establishing a secure trusted channel after the verification of the two parties passes.
Illustratively, after the verification of the backup trusted program of the backup machine X by the service machine B and the verification of the service trusted program of the service machine B by the backup machine X both pass, a secure trusted channel is established.
S1105, the backup machine X determines the data to be transmitted associated with the service trusted program stored in the local TEE.
And S1106, transmitting the data to be transmitted to the business machine B through the secure trusted channel.
S1107, the service trusted program of the service machine B determines the corresponding plaintext of the sealed data according to the data to be transmitted, and encrypts and stores the plaintext of the sealed data into a local TEE.
On the basis of the above technical solutions, the present disclosure also provides an optional embodiment, in which "determining data to be transmitted associated with a service trusted program stored in a local TEE" is further refined as "obtaining a recovery transmission public key of the service trusted program from a block chain; decrypting the sealed data ciphertext in the local TEE to obtain a sealed data plaintext, and encrypting the sealed data plaintext according to the recovery transmission public key to obtain a recovery transmission ciphertext of the sealed data; and generating data to be transmitted including the recovered transmission ciphertext. Correspondingly, the operation of sending the data to be transmitted to the service trusted program to enable the service trusted program to determine the corresponding sealed data plaintext according to the data to be transmitted is further refined into the operation of associating the data to be transmitted and the identification information of the service trusted program to uplink and store so as to enable the service trusted program chain to acquire the data to be transmitted, recovering the transmission private key according to the recovery transmission public key, and decrypting the recovery transmission ciphertext to obtain the sealed data plaintext, so that a data transmission mechanism based on the block chain is completed. It should be noted that, for parts not described in detail in the embodiments of the present disclosure, reference may be made to related expressions in other embodiments, and details are not described herein again.
Referring to fig. 12A, a method for backing up data stored in a TEE is shown, which is performed by a backup trusted program of a backup machine, and includes:
and S1210, acquiring a recovery transmission public key of the service trusted program from the block chain.
The service trusted program can generate an asymmetric key for data encryption and decryption in advance, recover the transmission public key and the transmission private key, store the recovered transmission public key and the identification information of the service trusted program in a block chain in a related manner, and locally store the recovered transmission private key for use.
Correspondingly, under the condition of meeting the data recovery requirement, the backup trusted program can acquire a recovery transmission public key from the block chain when responding to the recovery request so as to perform encrypted uplink transmission of the data to be transmitted.
S1220, decrypting the sealed data ciphertext in the local TEE to obtain a sealed data plaintext, and encrypting the sealed data plaintext according to the recovery transmission public key to obtain a recovery transmission ciphertext of the sealed data.
The backup trusted program can decrypt the sealed data ciphertext in the local TEE through the CPU hardware encryption key of the backup trusted program to obtain a sealed data plaintext; and encrypting the sealed data plaintext according to the recovery transmission public key to obtain a recovery transmission ciphertext of the sealed data.
And S1230, generating data to be transmitted including the recovery transmission ciphertext.
And S1240, associating the data to be transmitted and the identification information of the service trusted program for uplink storage so as to obtain the data to be transmitted on the service trusted program chain, recovering the transmission private key according to the recovery transmission public key, decrypting the recovery transmission ciphertext to obtain a sealed data plaintext, and encrypting and storing the sealed data plaintext into a local TEE.
For example, the backup trusted program may associate and chain-store the data to be transmitted and the identification information of the business trusted program. The service trusted program can obtain the corresponding data to be transmitted through the identification information of the service trusted program. The service trusted program can decrypt the recovered transmission ciphertext through the recovered transmission private key corresponding to the recovered transmission public key to obtain the recovered data plaintext.
It can be understood that, in order to improve the security of the data transmission and data recovery process, bidirectional authentication can be performed between the business trusted program and the backup trusted program, and data transmission and recovery are performed after the authentication is passed.
In an optional embodiment, the blockchain further stores remote authentication information of the service trusted program; acquiring remote verification information of the service trusted program from the block chain according to the identification information of the service trusted program; verifying the service trusted program according to the remote verification information and the recovery transmission public key of the service trusted program; and if the verification is passed, triggering and executing the uplink storage operation of associating the data to be transmitted and the identification information of the service trusted program.
The block chain stores remote verification information and a recovery transmission public key of the service trusted program. The remote verification information and the recovery transmission public key of the service trusted program stored in the block chain have a corresponding relation with the identification information. Namely, the remote verification information and the recovery transmission public key corresponding to the service trusted program can be obtained through the identification information of the service trusted program. Correspondingly, the backup trusted program can acquire the remote verification information of the service trusted program from the block chain according to the identification information of the service trusted program; the backup trusted program can perform trusted execution environment verification on the remote verification information of the service trusted program through the existing remote verification technology.
Optionally, the remote verification information of the trusted service program may be generated based on the hash data of the recovered transmission public key. Therefore, the remote verification information acquired from the backup trusted program chain may carry hash data for recovering the transmission public key. The hash data of the recovered transmission public key may be encrypted data obtained by hashing the recovered transmission public key through a preset hash algorithm.
In order to further improve the verification accuracy of the service trusted program, the service trusted program can be further verified through the remote verification information and the recovery transmission public key of the service trusted program. For example, the verification of the business trusted program may be an accuracy verification of a recovered transmission public key of the business trusted program.
In an optional embodiment, the verifying the service trusted program according to the remote verification information and the recovery transmission public key of the service trusted program includes: and recovering the hash data of the transmission public key according to the remote verification information of the service trusted program, and verifying and recovering the transmission public key.
For example, the backup trusted program may perform hash calculation on the recovery transmission public key acquired from the chain to obtain first hash data of the recovery transmission public key; taking the hash data of the recovery transmission public key in the remote verification information acquired from the chain as second hash data; the backup trusted program compares the consistency of the first hash data and the second hash data, and if the comparison result is consistent, the verification of the recovery transmission public key of the service trusted program is considered to pass; and if the comparison result is inconsistent, the verification of the recovery transmission public key of the service trusted program is not passed.
According to the optional embodiment, the method for verifying and recovering the transmission public key is realized by recovering the hash data of the transmission public key in the remote verification information of the service trusted program, so that the accurate verification of the transmission recovery public key of the service trusted program is realized, and the verification accuracy of the service trusted program is further improved.
It can be understood that, in order to facilitate the verification of the backup trusted program by the service trusted program and the verification of the data to be transmitted, which is uplink-stored in the trusted execution program, the backup trusted program may uplink-store the relevant data for verification as the data to be transmitted.
According to the scheme of the optional embodiment, the remote verification information of the service trusted program is acquired from the block chain, and the service trusted program is verified through the remote verification information, so that the safety verification of the backup trusted program on the service trusted program is realized, and the condition of data safety hidden danger caused by malicious impersonation of the service trusted program by a third party and uplink storage of related information of the service trusted program by a third party is avoided.
In order to inform the service trusted program of the accuracy of the recovered data, when the backup trusted program generates the data to be transmitted, the data to be transmitted may also carry related data for verifying the backup trusted program. In an optional embodiment, generating the data to be transmitted including the recovered transmission ciphertext includes: generating remote verification information of the backup trusted program; and generating to-be-transmitted data comprising the recovery transmission ciphertext and the remote verification information of the backup trusted program, so that the business trusted program verifies the recovery transmission ciphertext according to the remote verification information of the backup trusted program.
Exemplarily, the backup trusted program may carry hash data for recovering the transmission ciphertext, and generate remote verification information of the backup trusted program based on an existing remote verification information generation manner; and generating to-be-transmitted data comprising the recovery transmission ciphertext and the remote verification information of the backup trusted program, and associating and uplink-storing the to-be-transmitted data with the identification information of the service trusted program.
The service trusted program can acquire data to be transmitted corresponding to the identification information of the service trusted program from the chain according to the identification information of the service trusted program; and acquiring remote verification information of the recovery transmission ciphertext and the backup trusted program from the data to be transmitted, and verifying the recovery transmission ciphertext according to the remote verification information.
Illustratively, the trusted execution environment is verified based on the existing remote verification mechanism for the remote verification information of the backup trusted program.
In order to further ensure the accuracy of recovering the transmission ciphertext, in an optional embodiment, the backup trusted program may generate the remote verification information of the backup trusted program according to the hash data of the transmission ciphertext, and therefore, the remote verification information acquired by the service trusted program chain includes the hash data of the transmission ciphertext. Correspondingly, the service trusted program can verify the recovery transmission ciphertext according to the matching condition of the recovery transmission ciphertext and the hash data of the recovery transmission ciphertext carried in the remote verification information of the backup trusted program.
Further, the remote verification information of the backup trusted program also carries fingerprint information of the backup trusted program; the corresponding service trusted program can carry out accuracy verification on the backup trusted program according to the consistency of the fingerprint information of the local hard code and the fingerprint information of the backup trusted program in the remote verification information acquired on the chain.
In the optional embodiment, the remote verification information of the backup trusted program is generated according to the hash data of the recovery transmission ciphertext, and the to-be-transmitted data including the recovery transmission ciphertext and the remote verification information of the backup trusted program is generated; the service trusted program can verify the recovery transmission ciphertext through the data to be transmitted, so that the service trusted program can verify the backup trusted program, bidirectional verification between the backup trusted program and the service trusted program is realized, data security is improved, and the recovery transmission ciphertext is prevented from being maliciously tampered by a third party.
According to the scheme of the embodiment of the disclosure, the recovery transmission public key of the service trusted program is obtained from the block chain; decrypting the sealed data ciphertext in the local TEE to obtain a sealed data plaintext, and encrypting the sealed data plaintext according to a recovery transmission public key to obtain a recovery transmission ciphertext of the sealed data; and generating data to be transmitted including recovery transmission ciphertext, and associating the data to be transmitted and the identification information of the service trusted program for uplink storage. According to the scheme, the block chain is introduced, and the data to be transmitted are stored in the block chain, so that the condition that the backup machine is damaged to cause data loss is prevented. And the data is stored on the block chain, so that the safety of data recovery is improved.
In a specific embodiment, an interaction flow diagram of a method for recovering data stored within a TEE is shown in fig. 12B.
S1201, the service trusted program of the service machine B generates an asymmetric key comprising a recovery transmission private key and a recovery transmission public key.
And S1202, generating remote verification information according to the Hash data of the recovered transmission public key.
S1203, the recovered transmission public key and the remote verification information are uplink stored.
And S1204, the service trusted program of the service machine B acquires the recovery request.
The recovery request may include identification information of the backup trusted program in the backup machine X.
And S1205, the service machine B sends a recovery request to the block chain.
S1206, the backup machine X polls the block chain to obtain a recovery request, and responds to the recovery request, and a recovery transmission public key and remote verification information of the service trusted program are obtained from the block chain.
For example, the backup machine X may obtain the recovery transmission public key of the service trusted program from the block chain according to the identification information of the service trusted program of the service machine B in response to the on-chain recovery request.
S1207, decrypting the sealed data ciphertext in the local TEE according to the hard coding key of the local TEE to obtain a sealed data plaintext.
And S1208, encrypting the sealed data plaintext according to the recovery transmission public key to obtain a recovery transmission ciphertext.
S1209, remote verification information is generated based on the Hash data of the recovered transmission ciphertext.
S1210, generating data to be transmitted, wherein the data to be transmitted comprises the recovery transmission ciphertext and the remote verification information.
S1211, the backup machine X verifies the service credible program of the service machine B according to the remote verification information and the recovery transmission public key.
S1212, performing public key verification on the recovered transmission public key according to the hash data of the recovered transmission public key in the remote verification information; and performing program fingerprint verification on the service trusted program according to the consistency of the fingerprint information of the service trusted program in the remote verification information and the hard-coded fingerprint information in the backup trusted program.
And S1213, after the verification of the service trusted program is passed, uplink storage is carried out on the data to be transmitted.
For example, the backup machine X may associate the data to be transmitted and the identification information of the service trusted program to be uplink-stored.
S1214, the service trusted program of the service machine B acquires the data to be transmitted from the chain.
S1215, verifying the recovered transmission ciphertext according to the hash data of the recovered transmission ciphertext of the remote verification information in the data to be transmitted.
For example, the data to be transmitted may carry remote verification information of the backup trusted program generated by the backup machine X according to the hash data of the recovered transmission ciphertext. The service machine B can verify the transmission recovery ciphertext according to the matching condition of the transmission ciphertext and the hash data of the transmission recovery ciphertext carried in the remote verification information of the backup trusted program.
And S1216, after the verification of the recovered transmission ciphertext is passed, decrypting the recovered transmission ciphertext according to the recovered transmission private key to obtain a sealed data plaintext.
S1217, encrypting the sealed data plaintext based on the hard coding key of the user, and storing the sealed data plaintext into the local TEE.
As an implementation of the above backup method for the stored data in each TEE, the present disclosure further provides an optional embodiment of an execution device that implements the above backup method for the stored data in each TEE.
Fig. 13 is a schematic diagram of a device for backing up data stored in a TEE according to an embodiment of the present disclosure, where this embodiment may be applied to an application scenario in which data stored in a trusted execution environment is backed up, and the device may be configured in an electronic device, where the electronic device may be a service machine, and may implement a method for backing up data stored in a TEE according to any embodiment of the present disclosure. Referring to fig. 13, the backup device 1300 for storing data in the TEE specifically includes the following components:
a backup request obtaining module 1301, configured to obtain a backup request; the backup request comprises identification information of a backup trusted program in a backup machine;
a to-be-transmitted data generating module 1302, configured to generate to-be-transmitted data according to an original ciphertext of sealed data in the local TEE;
and the to-be-transmitted data sending module 1303 is configured to send the to-be-transmitted data to the backup trusted program according to the identification information of the backup trusted program, so that the backup trusted program determines a sealed data plaintext according to the to-be-transmitted data, and performs associated encryption backup on the sealed data plaintext and the service trusted program in the local TEE.
According to the scheme of the embodiment of the invention, the data to be transmitted is generated by the service trusted program according to the original ciphertext of the sealed data in the local TEE, and the data to be transmitted is sent to the backup trusted program according to the identification information of the backup trusted program, so that the backup trusted program determines the sealed data plaintext, and the sealed data plaintext and the service trusted program are encrypted and backed up in a local TEE in a correlated manner, thereby realizing the backup storage of the sealed data in the trusted execution environment of the service machine and avoiding the permanent loss of the sealed data caused by the fault or damage of the service machine.
In an optional implementation manner, the data to be transmitted is the sealed data plaintext; the data sending module 1303 to be transmitted includes:
the program verification unit is used for verifying the backup trusted program;
the safe trusted channel establishing unit is used for establishing a safe trusted channel between the business trusted program and the backup trusted program after the business trusted program passes verification and the backup trusted program passes verification on the business trusted program;
and the sealed data plaintext sending unit is used for sending the sealed data plaintext to the backup trusted program through the safe trusted channel.
In an optional embodiment, the service trusted program is hard-coded with fingerprint information of the backup trusted program; the program verifying unit includes:
the trusted execution environment verification subunit is used for performing trusted execution environment verification on the backup trusted program;
and the program fingerprint verification subunit is used for performing program fingerprint verification on the backup trusted program according to the consistency between the fingerprint information of the backup trusted program carried in the verification result and the hard-coded fingerprint information in the service trusted program if the verification is passed.
In an optional implementation manner, the data generation module 1302 to be transmitted includes:
a transmission public key obtaining unit, configured to obtain a backup transmission public key of the backup trusted program from a block chain according to the identification information of the backup trusted program;
the original text ciphertext decryption unit is used for decrypting an original ciphertext in a local TEE to obtain the sealed data plaintext, and encrypting the sealed data plaintext according to the backup transmission public key to obtain a backup transmission ciphertext of the sealed data;
the data to be transmitted generating unit is used for generating the data to be transmitted comprising the backup transmission ciphertext;
the data sending module 1303 to be transmitted includes:
and the data cochain storage unit is used for correlating and cochain-storing the data to be transmitted and the identification information of the backup trusted program so as to enable the backup trusted program to obtain the data to be transmitted on a chain according to the identification information of the backup trusted program, and decrypt the data to be transmitted according to a backup transmission private key corresponding to the backup transmission public key to obtain the sealed data plaintext.
In an optional implementation manner, the blockchain further stores therein remote verification information of the backup trusted program generated based on hash data of the backup transmission public key; the apparatus 130 further comprises:
the remote verification information acquisition module is used for acquiring remote verification information of the backup trusted program generated based on the hash data of the backup transmission public key from the block chain according to the identification information of the backup trusted program;
the backup trusted program verification module is used for verifying the backup trusted program according to the remote verification information of the backup trusted program and the backup transmission public key;
and the associated uplink storage module is used for triggering and executing the operation of associating the data to be transmitted and the identification information of the backup trusted program with uplink storage if the verification is passed.
In an optional embodiment, the backup trusted program verification module comprises:
and the transmission public key verification unit is used for verifying the backup transmission public key according to the hash data of the backup transmission public key in the remote verification information of the backup trusted program.
In an optional embodiment, the backup trusted program verification module comprises:
and the program fingerprint verification unit is used for performing program fingerprint verification on the backup trusted program according to the consistency between the fingerprint information of the backup trusted program in the remote verification information of the backup trusted program and the hard-coded fingerprint information in the service trusted program.
In an optional implementation manner, the data generation unit to be transmitted includes:
the verification information generation subunit is used for generating the remote verification information of the service trusted program according to the hash data of the backup transmission ciphertext;
and the data to be transmitted generating subunit is used for generating the data to be transmitted, which comprises the backup transmission ciphertext and the remote verification information of the service trusted program, so that the backup trusted program verifies the backup transmission ciphertext according to the remote verification information of the service trusted program.
In an optional embodiment, the number of the backup trusted programs is at least two, and the fingerprint information of different backup trusted programs is the same.
The backup device for the TEE memory data can execute the backup method for the TEE memory data provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects for executing the backup method for the TEE memory data.
Fig. 14 is a schematic diagram of a backup apparatus for data stored in a TEE according to an embodiment of the present disclosure, this embodiment may be applied to an application scenario of backing up data stored in a trusted execution environment, and the apparatus may be configured in an electronic device, where the electronic device may be a backup machine, and may implement the method for backing up data stored in a TEE according to any embodiment of the present disclosure. Referring to fig. 14, the backup apparatus 1400 for storing data in a TEE specifically includes the following components:
a to-be-transmitted data acquisition module 1401 configured to acquire data to be transmitted; the data to be transmitted is generated by a service trusted program in a service machine according to an original ciphertext of sealed data in a local TEE, and is sent according to identification information of a backup trusted program in an obtained backup request;
a sealed data plaintext determining module 1402, configured to determine a sealed data plaintext according to the data to be transmitted;
and an associated encryption backup module 1403, configured to associate the sealed data plaintext with the service trusted program in a local TEE for encryption backup.
According to the scheme of the embodiment of the disclosure, the sealed data plaintext is determined according to the acquired to-be-transmitted data, and the sealed data plaintext and the service trusted program are encrypted and backed up in a local TEE in a related manner, so that the sealed data inside the trusted execution environment of the service machine can be backed up and stored, and the condition that the sealed data is permanently lost due to the fault or damage of the service machine is avoided.
In an optional embodiment, the data to be transmitted is the plaintext of the sealed data; the data to be transmitted obtaining module 1401 includes:
the trusted program verifying unit is used for verifying the service trusted program;
the safe trusted channel establishing unit is used for establishing a safe trusted channel between the business trusted program and the backup trusted program after the business trusted program passes the verification and the backup trusted program passes the verification;
and the sealed data plaintext acquisition unit is used for acquiring the sealed data plaintext through the safe and credible channel.
In an optional embodiment, the trusted program verification unit comprises:
the trusted execution environment verification subunit is used for performing trusted execution environment verification on the service trusted program and acquiring fingerprint information of the service trusted program carried in a verification result;
the associated encrypted backup module 1403 includes:
and the associated encryption backup unit is used for associating the sealed data plaintext with the fingerprint information of the service trusted program for encryption backup in a local TEE.
In an alternative embodiment, the apparatus 1400 further comprises:
the associated uplink storage module is used for generating an asymmetric key comprising a backup transmission private key and a backup transmission public key before the data to be transmitted is obtained, and storing the backup transmission public key and the identification information of the backup transmission public key in an associated uplink manner;
the data to be transmitted obtaining module 1401 includes:
the device comprises a to-be-transmitted data acquisition unit, a to-be-transmitted data acquisition unit and a to-be-transmitted data acquisition unit, wherein the to-be-transmitted data acquisition unit is used for acquiring the to-be-transmitted data from a block chain according to identification information of the to-be-transmitted data acquisition unit; the data to be transmitted comprises a backup transmission ciphertext of the sealed data; the backup transmission ciphertext is generated by encrypting a sealed data plaintext obtained by decrypting an original ciphertext in a local TEE by the service trusted program based on a backup transmission public key of the backup trusted program acquired from the identification information chain of the backup trusted program;
the sealed data plaintext determination module 1402 includes:
and the sealed data plaintext determining unit is used for decrypting the backup transmission ciphertext according to the backup transmission private key to obtain the sealed data plaintext.
In an optional embodiment, the associated uplink storage module includes:
the remote verification information generating unit is used for generating remote verification information of the backup trusted program according to the hash data of the backup transmission public key;
and the associated uplink storage unit is used for associating and uplink storing the backup transmission public key, the remote verification information of the backup trusted program and the identification information of the backup trusted program, so that the service trusted program can obtain the remote verification information of the backup trusted program in a link manner according to the identification information of the backup trusted program, and verify the backup trusted program according to the remote verification information of the backup trusted program and the backup transmission public key.
In an optional implementation manner, the data to be transmitted further includes remote verification information of the service trusted program, which is generated based on hash data of a backup transmission ciphertext;
the apparatus 1400 further comprises:
and the transmission ciphertext verification module is used for verifying the backup transmission ciphertext according to the remote verification information of the service trusted program before decrypting the backup transmission ciphertext according to the backup transmission private key to obtain the sealed data plaintext.
In an optional implementation manner, the transmission ciphertext verification module includes:
and the transmission ciphertext verification unit is used for verifying the backup transmission ciphertext according to the matching condition of the backup transmission ciphertext and the hash data of the backup transmission ciphertext carried in the remote verification information of the service trusted program.
The backup device for the TEE internal storage data can execute the backup method for the TEE internal storage data provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of executing the backup method for the TEE internal storage data.
As an implementation of the above method for restoring the data stored in each TEE, the present disclosure also provides an optional embodiment of an execution device that implements the above method for restoring the data stored in each TEE.
Fig. 15 is a schematic diagram of a device for recovering data stored in a TEE according to an embodiment of the present disclosure, where this embodiment may be applied to an application scenario of data recovery after backup is performed on stored data in a trusted execution environment, and the device may be configured in an electronic device, where the electronic device may be a recovery machine, and may implement a method for recovering data stored in a TEE according to any embodiment of the present disclosure. Referring to fig. 15, the apparatus 1500 for restoring data stored in a TEE specifically includes the following:
a recovery request obtaining module 1501, configured to obtain a recovery request; the recovery request comprises identification information of a backup trusted program in the backup machine;
a sealed data plaintext determination module 1502, configured to obtain, according to the identification information of the backup trusted program, data to be transmitted associated with the backup trusted program, and determine a plaintext of corresponding sealed data according to the data to be transmitted;
and the sealed data plaintext storage module 1503 is used for encrypting and storing the sealed data plaintext into the local TEE.
According to the scheme of the embodiment of the disclosure, the self-associated data to be transmitted is acquired from the backup trusted program according to the identification information of the backup trusted program in the acquired recovery request, and the plaintext of the corresponding sealed data is determined according to the data to be transmitted; the sealed data is stored into the local TEE in a plain text encryption mode, the sealed data inside the TEE of the backup machine is recovered and stored, and reliable sealed data recovery guarantee is provided when the sealed data is lost due to the failure or damage of the service machine.
In an optional implementation manner, the data to be transmitted is the sealed data plaintext;
the sealed data plaintext determination module 1502 includes:
the backup trusted program verifying unit is used for verifying the backup trusted program;
the safe trusted channel establishing unit is used for establishing a safe trusted channel between the business trusted program and the backup trusted program after the business trusted program passes verification and the backup trusted program passes verification on the business trusted program;
and the sealed data plaintext acquisition unit is used for acquiring self-associated sealed data plaintext from the backup trusted program through the safe trusted channel.
In an optional embodiment, the service trusted program is hard-coded with fingerprint information of the backup trusted program;
the backup trusted program verification unit includes:
the trusted execution environment verification subunit is used for performing trusted execution environment verification on the backup trusted program;
and the fingerprint verification subunit is used for performing program fingerprint verification on the backup trusted program according to the consistency between the fingerprint information of the backup trusted program carried in the verification result and the hard-coded fingerprint information in the service trusted program if the verification is passed.
In an alternative embodiment, the apparatus 1500 further comprises:
the asymmetric key generation module is used for generating an asymmetric key comprising a recovery transmission private key and a recovery transmission public key before acquiring self-associated data to be transmitted from the backup trusted program according to the identification information of the backup trusted program, and linking and storing the recovery transmission public key and the self-identification information in an associated manner;
the sealed data plaintext determination module 1502 includes:
a recovery request sending unit, configured to send the recovery request to a block chain, so that the backup trusted program obtains the recovery transmission public key in the chain in response to the recovery request, generates to-be-transmitted data including a recovery transmission ciphertext, and stores the to-be-transmitted data and the identification information of the service trusted program in an association chain; the recovery transmission ciphertext is obtained by encrypting a decryption result of the sealed data ciphertext related to the service trusted program by the backup trusted program based on the recovery transmission public key;
and the recovery transmission ciphertext decryption unit is used for obtaining the data to be transmitted on the chain according to the identification information of the recovery transmission ciphertext and decrypting the recovery transmission ciphertext according to the recovery transmission private key to obtain the sealed data plaintext.
In an optional implementation, the asymmetric key generation module includes:
the remote verification information generating unit is used for generating remote verification information of the service trusted program according to the Hash data of the recovery transmission public key;
and the data uplink storage unit is used for performing uplink storage on the recovery transmission public key, the remote verification information of the service trusted program and the identification information of the service trusted program in a correlated manner, so that the backup trusted program obtains the remote verification information of the service trusted program in a linked manner according to the identification information of the service trusted program, and verifies the service trusted program according to the remote verification information of the service trusted program.
In an optional implementation manner, the data to be transmitted further includes remote verification information of the backup trusted program generated based on hash data of the recovery transmission ciphertext; the sealed data plaintext determination module 1502 further includes:
and the recovery transmission ciphertext verification unit is used for verifying the recovery transmission ciphertext according to the remote verification information of the backup trusted program before decrypting the recovery transmission ciphertext according to the recovery transmission private key to obtain the sealed data plaintext.
In an optional implementation manner, the recovery transmission ciphertext verification unit includes:
and the recovery transmission ciphertext verification subunit is used for verifying the recovery transmission ciphertext according to the matching condition of the recovery transmission ciphertext and the hash data of the recovery transmission ciphertext carried in the remote verification information of the backup trusted program.
In an optional implementation, the recovery transmission ciphertext verification unit includes:
and the program fingerprint verification subunit is used for performing program fingerprint verification on the backup trusted program according to the consistency between the fingerprint information of the backup trusted program in the remote verification information of the backup trusted program and the hard-coded fingerprint information in the service trusted program.
The recovery device for the TEE stored data can execute the recovery method for the TEE stored data provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects for executing the recovery method for the TEE stored data.
Fig. 16 is a schematic diagram of a device for restoring data stored in a TEE according to an embodiment of the present disclosure, where the embodiment is applicable to an application scenario of data restoration after backup of stored data in a trusted execution environment, and the device may be configured in an electronic device, where the electronic device may be a backup machine, and may implement a method for restoring data stored in a TEE according to any embodiment of the present disclosure. Referring to fig. 16, the recovery apparatus 1600 for data stored in a TEE specifically includes the following components:
a to-be-transmitted data determining module 1601, configured to determine to-be-transmitted data associated with a service trusted program stored in a local TEE;
a sealed data plaintext storage module 1602, configured to send the data to be transmitted to the service trusted program, so that the service trusted program determines a corresponding sealed data plaintext according to the data to be transmitted, and encrypts and stores the sealed data plaintext into a local TEE.
According to the technical scheme, the data to be transmitted associated with the service trusted program stored in the local TEE are determined, the data to be transmitted are sent to the service trusted program, so that the service trusted program determines the corresponding sealed data plaintext according to the data to be transmitted, and the sealed data plaintext is encrypted and stored in the local TEE, recovery and storage of the sealed data inside the TEE of the backup machine are achieved, and reliable sealed data recovery guarantee is provided when the sealed data are lost due to failure or damage of the service machine.
In an optional implementation manner, the data to be transmitted is the sealed data plaintext; the apparatus 1600, further comprising:
the service trusted program verification module is used for verifying the service trusted program before the data to be transmitted is sent to the service trusted program;
the safe trusted channel establishing module is used for establishing a safe trusted channel between the business trusted program and the backup trusted program after the business trusted program passes the verification and the backup trusted program passes the verification;
the sealed data plaintext storage module 1602 includes:
and the sealed data plaintext transmission unit is used for transmitting the sealed data plaintext to the service trusted program through the safe trusted channel.
In an optional embodiment, the service trusted program verification module includes:
the fingerprint information acquisition unit is used for carrying out trusted execution environment verification on the service trusted program and acquiring fingerprint information of the service trusted program carried in a verification result;
the sealed data plaintext storage module 1602 includes:
and the sealed data plaintext determining unit is used for determining the sealed data plaintext associated with the service trusted program in the local TEE according to the fingerprint information of the service trusted program.
In an optional implementation, the module 1601 for determining data to be transmitted includes:
a recovery transmission public key obtaining unit, configured to obtain a recovery transmission public key of the service trusted program from the block chain;
the recovery transmission ciphertext acquisition unit is used for decrypting the sealed data ciphertext in the local TEE to obtain a sealed data plaintext, and encrypting the sealed data plaintext according to the recovery transmission public key to obtain a recovery transmission ciphertext of the sealed data;
the data to be transmitted generating unit is used for generating data to be transmitted comprising the recovery transmission ciphertext;
the sealed data plaintext storage module 1602 includes:
and the data cochain storage unit is used for correlating and cochain-storing the data to be transmitted and the identification information of the service trusted program so as to obtain the data to be transmitted on the service trusted program chain, recovering a transmission private key according to the recovery transmission public key, and decrypting the recovery transmission ciphertext to obtain the sealed data plaintext.
In an optional implementation manner, the blockchain further stores therein remote verification information of the service trusted program generated based on hash data of the recovery transmission public key; the apparatus 1600, further comprising:
the remote verification information acquisition module is used for acquiring remote verification information of the service trusted program generated based on the Hash data of the recovery transmission public key from the block chain according to the identification information of the service trusted program;
the service trusted program verification module is used for verifying the service trusted program according to the remote verification information of the service trusted program and the recovery transmission public key;
and the uplink storage triggering module is used for triggering and executing uplink storage operation of associating the data to be transmitted and the identification information of the service trusted program if the verification is passed.
In an optional embodiment, the service trusted program verification module includes:
and the recovery transmission public key verification unit is used for verifying the recovery transmission public key according to the hash data of the recovery transmission public key in the remote verification information of the service trusted program.
In an optional embodiment, the data generation unit to be transmitted includes:
the remote verification information generation subunit is used for generating remote verification information of the backup trusted program according to the hash data of the recovery transmission ciphertext;
and the recovery transmission ciphertext verification subunit is used for generating the data to be transmitted, which comprises the recovery transmission ciphertext and the remote verification information of the backup trusted program, so that the business trusted program verifies the recovery transmission ciphertext according to the remote verification information of the backup trusted program.
The recovery device for the TEE stored data can execute the recovery method for the TEE stored data provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects for executing the recovery method for the TEE stored data.
In the technical scheme of the disclosure, the related backup request, recovery request, collection, storage, use, processing, transmission, provision, disclosure and other processing of the data to be transmitted all conform to the regulations of related laws and regulations, and do not violate the customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
Fig. 17 illustrates a schematic block diagram of an example electronic device 1700 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 17, the apparatus 1700 includes a computing unit 1701 that may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM) 1702 or a computer program loaded from a storage unit 1708 into a Random Access Memory (RAM) 1703. In the RAM 1703, various programs and data required for the operation of the device 1700 can also be stored. The computing unit 1701, the ROM 1702, and the RAM 1703 are connected to each other through a bus 1704. An input/output (I/O) interface 1705 is also connected to bus 1704.
Various components in the device 1700 are connected to the I/O interface 1705, including: an input unit 1706 such as a keyboard, a mouse, and the like; an output unit 1707 such as various types of displays, speakers, and the like; a storage unit 1708 such as a magnetic disk, optical disk, or the like; and a communication unit 1709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 1709 allows the device 1700 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 1701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The computing unit 1701 performs the various methods and processes described above, such as a backup of the in-TEE storage data and/or a restore method of the in-TEE storage data. For example, in some embodiments, the backup of data stored within the TEE and/or the recovery method of data stored within the TEE may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 1708. In some embodiments, part or all of a computer program may be loaded and/or installed onto device 1700 via ROM 1702 and/or communications unit 1709. When the computer program is loaded into RAM 1703 and executed by the computing unit 1701, one or more steps of the backup of in-TEE data and/or restore method of in-TEE data described above may be performed. Alternatively, in other embodiments, the computing unit 1701 may be configured in any other suitable manner (e.g., by way of firmware) to perform a backup of the data within the TEE and/or a recovery method of the data within the TEE.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome. The server may also be a server of a distributed system, or a server incorporating a blockchain.
Artificial intelligence is the subject of research that makes computers simulate some human mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), both at the hardware level and at the software level. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning/deep learning technology, a big data processing technology, a knowledge map technology and the like.
Cloud computing (cloud computing) refers to a technology system that accesses a flexibly extensible shared physical or virtual resource pool through a network, where resources may include servers, operating systems, networks, software, applications, storage devices, and the like, and may be deployed and managed in a self-service manner as needed. Through the cloud computing technology, high-efficiency and strong data processing capacity can be provided for technical application such as artificial intelligence and block chains and model training.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in this disclosure may be performed in parallel or sequentially or in a different order, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and are not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (41)

1. A backup method for data stored in a TEE is executed by a service trusted program of a service machine, and comprises the following steps:
obtaining a backup request; the backup request comprises identification information of a backup trusted program in a backup machine;
generating data to be transmitted according to an original ciphertext of the sealed data in the local trusted execution environment;
and sending the data to be transmitted to the backup trusted program according to the identification information of the backup trusted program, so that the backup trusted program determines a sealed data plaintext according to the data to be transmitted, and performs related encryption backup on the sealed data plaintext and the service trusted program in a local trusted execution environment.
2. The method according to claim 1, wherein the data to be transmitted is the sealed data plaintext;
the sending the data to be transmitted to the backup trusted program according to the identification information of the backup trusted program comprises the following steps:
verifying the backup trusted program;
after the business trusted program passes the verification and the backup trusted program passes the verification of the business trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program;
and sending the sealed data plaintext to the backup trusted program through the safe trusted channel.
3. The method of claim 2, wherein the business trusted program is hard-coded with fingerprint information of the backup trusted program;
the verifying the backup trusted program comprises:
performing trusted execution environment verification on the backup trusted program;
and if the verification is passed, performing program fingerprint verification on the backup trusted program according to the consistency of the fingerprint information of the backup trusted program carried in the verification result and the hard-coded fingerprint information in the service trusted program.
4. The method of claim 1, wherein generating the data to be transmitted from an original ciphertext of the sealed data within the local trusted execution environment comprises:
acquiring a backup transmission public key of the backup trusted program from a block chain according to the identification information of the backup trusted program;
decrypting an original ciphertext in a local trusted execution environment to obtain the sealed data plaintext, and encrypting the sealed data plaintext according to the backup transmission public key to obtain a backup transmission ciphertext of the sealed data;
generating the data to be transmitted comprising the backup transmission ciphertext;
the sending the data to be transmitted to the backup trusted program according to the identification information of the backup trusted program so that the backup trusted program determines a sealed data plaintext according to the data to be transmitted, includes:
and associating and chaining the data to be transmitted and the identification information of the backup trusted program for storage, so that the backup trusted program obtains the data to be transmitted on the chain according to the identification information of the backup trusted program, and decrypting the data to be transmitted according to a backup transmission private key corresponding to the backup transmission public key to obtain the sealed data plaintext.
5. The method of claim 4, wherein the blockchain further stores therein remote authentication information of the backup trusted program generated based on hash data of the backup transmission public key; the method further comprises the following steps:
according to the identification information of the backup trusted program, acquiring remote verification information of the backup trusted program generated based on hash data of the backup transmission public key from the block chain;
verifying the backup trusted program according to the remote verification information of the backup trusted program and the backup transmission public key;
and if the verification is passed, triggering and executing the uplink storage operation of associating the data to be transmitted and the identification information of the backup trusted program.
6. The method of claim 5, wherein the verifying the backup trusted program based on the remote verification information of the backup trusted program and the backup transmission public key comprises:
and verifying the backup transmission public key according to the hash data of the backup transmission public key in the remote verification information of the backup trusted program.
7. The method of claim 5, wherein the verifying the backup trusted program based on the remote verification information of the backup trusted program and the backup transmission public key comprises:
and performing program fingerprint verification on the backup trusted program according to the consistency of the fingerprint information of the backup trusted program in the remote verification information of the backup trusted program and the hard-coded fingerprint information in the service trusted program.
8. The method of claim 4, wherein the generating the data to be transmitted including the backup transmission ciphertext comprises:
generating remote verification information of the service trusted program according to the hash data of the backup transmission ciphertext;
and generating the data to be transmitted, which comprises the backup transmission ciphertext and the remote verification information of the service trusted program, so that the backup trusted program verifies the backup transmission ciphertext according to the remote verification information of the service trusted program.
9. The method of claim 3 or 7, wherein the number of the backup trusted programs is at least two, and fingerprint information of different backup trusted programs is the same.
10. A backup method of data stored in a TEE is executed by a backup trusted program of a backup machine, and comprises the following steps:
acquiring data to be transmitted; the data to be transmitted is generated by a service trusted program in a service machine according to an original ciphertext of sealed data in a local trusted execution environment, and is sent according to identification information of a backup trusted program in an acquired backup request;
determining a sealed data plaintext according to the data to be transmitted;
and associating the sealed data plaintext with the service trusted program in a local trusted execution environment for encryption and backup.
11. The method according to claim 10, wherein the data to be transmitted is the sealed data plaintext;
the acquiring the data to be transmitted includes:
verifying the service trusted program;
after the verification is passed and the business trusted program passes the verification of the backup trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program;
and acquiring the sealed data plaintext through the safe and credible channel.
12. The method of claim 11, wherein the verifying the business trusted program comprises:
the trusted execution environment of the service trusted program is verified, and fingerprint information of the service trusted program carried in a verification result is obtained;
the associating, encrypting and backing up the sealed data plaintext and the service trusted program in the local trusted execution environment includes:
and performing related encryption backup on the sealed data plaintext and the fingerprint information of the service trusted program in a local trusted execution environment.
13. The method of claim 10, wherein prior to the obtaining data to be transmitted, the method further comprises:
generating an asymmetric key comprising a backup transmission private key and a backup transmission public key, and associating the backup transmission public key with self identification information for uplink storage;
the acquiring of the data to be transmitted includes:
acquiring the data to be transmitted from a block chain according to the identification information of the data to be transmitted; the data to be transmitted comprises a backup transmission ciphertext of the sealed data; the backup transmission ciphertext is generated by encrypting a sealed data plaintext obtained by decrypting an original ciphertext in a local trusted execution environment by the service trusted program based on a backup transmission public key of the backup trusted program acquired from the identification information chain of the backup trusted program;
determining a sealed data plaintext according to the data to be transmitted, including:
and decrypting the backup transmission ciphertext according to the backup transmission private key to obtain the sealed data plaintext.
14. The method of claim 13, wherein the associating the backup transmission public key with self-identity information uplink storage comprises:
generating remote verification information of the backup trusted program according to the hash data of the backup transmission public key;
and associating and chain-storing the backup transmission public key, the remote verification information of the backup trusted program and the identification information of the backup trusted program, so that the service trusted program can obtain the remote verification information of the backup trusted program in a chain manner according to the identification information of the backup trusted program, and verify the backup trusted program according to the remote verification information of the backup trusted program and the backup transmission public key.
15. The method according to claim 13, wherein the data to be transmitted further includes remote verification information of the service trusted program generated based on hash data of a backup transmission ciphertext;
before the decrypting the backup transmission ciphertext according to the backup transmission private key to obtain the sealed data plaintext, the method further includes:
and verifying the backup transmission ciphertext according to the remote verification information of the service trusted program.
16. The method of claim 15, wherein the verifying the backup transmission ciphertext according to the remote verification information of the business trusted program comprises:
and verifying the backup transmission ciphertext according to the matching condition of the backup transmission ciphertext and the hash data of the backup transmission ciphertext carried in the remote verification information of the service trusted program.
17. A method for recovering data stored in a TEE, which is executed by a service credible program of a recovery machine, comprises the following steps:
acquiring a recovery request; the recovery request comprises identification information of a backup trusted program in the backup machine;
acquiring self-associated data to be transmitted from the backup trusted program according to the identification information of the backup trusted program, and determining a plaintext of corresponding sealed data according to the data to be transmitted;
and encrypting and storing the sealed data into a local trusted execution environment in a plain text mode.
18. The method of claim 17, wherein the data to be transmitted is the sealed data plaintext;
the acquiring, according to the identification information of the backup trusted program, data to be transmitted associated with the backup trusted program from the backup trusted program, and determining a plaintext of corresponding sealed data according to the data to be transmitted, includes:
verifying the backup trusted program;
after the business trusted program passes the verification and the backup trusted program passes the verification of the business trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program;
and acquiring self-associated sealed data plaintext from the backup trusted program through the secure trusted channel.
19. The method of claim 18, wherein the business trusted program has fingerprint information of the backup trusted program hard-coded therein;
the verifying the backup trusted program comprises:
performing trusted execution environment verification on the backup trusted program;
and if the verification is passed, performing program fingerprint verification on the backup trusted program according to the consistency of the fingerprint information of the backup trusted program carried in the verification result and the hard-coded fingerprint information in the service trusted program.
20. The method of claim 17, wherein before the obtaining of the data to be transmitted associated with the backup trusted program from the backup trusted program according to the identification information of the backup trusted program, the method further comprises:
generating an asymmetric key comprising a recovery transmission private key and a recovery transmission public key, and associating and uplink-storing the recovery transmission public key and self identification information;
the acquiring, according to the identification information of the backup trusted program, data to be transmitted associated with the backup trusted program from the backup trusted program, and determining a plaintext of corresponding sealed data according to the data to be transmitted, includes:
sending the recovery request to a block chain, so that the backup trusted program responds to the recovery request, the recovery transmission public key is obtained on the chain, data to be transmitted including a recovery transmission ciphertext is generated, and the data to be transmitted and the identification information of the service trusted program are stored in a related chain; the recovery transmission ciphertext is obtained by encrypting a decryption result of a sealed data ciphertext related to the service trusted program by the backup trusted program based on the recovery transmission public key;
and acquiring the data to be transmitted on the chain according to the identification information of the data to be transmitted, and decrypting the transmission recovery ciphertext according to the transmission recovery private key to obtain the sealed data plaintext.
21. The method of claim 20, wherein the associating the recovered transmission public key with self-identity information uplink storage comprises:
generating remote verification information of the service trusted program according to the Hash data of the recovery transmission public key;
and linking and storing the recovery transmission public key, the remote verification information of the service trusted program and the identification information of the service trusted program in an associated manner, so that the backup trusted program obtains the remote verification information of the service trusted program in a link manner according to the identification information of the service trusted program and verifies the service trusted program according to the remote verification information of the service trusted program.
22. The method according to claim 20, wherein the data to be transmitted further includes remote verification information of the backup trusted program generated based on hash data of the recovery transmission ciphertext;
before the decrypting the recovered transmission ciphertext according to the recovered transmission private key to obtain the sealed data plaintext, the method further includes:
and verifying the recovery transmission ciphertext according to the remote verification information of the backup trusted program.
23. The method of claim 22, wherein the verifying the recovery transmission ciphertext according to the remote verification information of the backup trusted program comprises:
and verifying the recovery transmission ciphertext according to the matching condition of the recovery transmission ciphertext and the hash data of the recovery transmission ciphertext carried in the remote verification information of the backup trusted program.
24. The method of claim 22, wherein the verifying the recovery transmission ciphertext according to the remote verification information of the backup trusted program comprises:
and performing program fingerprint verification on the backup trusted program according to the consistency between the fingerprint information of the backup trusted program in the remote verification information of the backup trusted program and the hard-coded fingerprint information in the service trusted program.
25. A method for recovering data stored in a TEE is executed by a backup trusted program of a backup machine, and comprises the following steps:
determining to-be-transmitted data associated with a service trusted program stored in a local trusted execution environment;
and sending the data to be transmitted to the service trusted program so that the service trusted program determines a corresponding sealed data plaintext according to the data to be transmitted, and encrypting and storing the sealed data plaintext into a local trusted execution environment.
26. The method of claim 25, wherein the data to be transmitted is the sealed data plaintext;
before the sending the data to be transmitted to the service trusted program, the method further comprises:
verifying the service trusted program;
after the verification is passed and the business trusted program passes the verification of the backup trusted program, establishing a safe trusted channel between the business trusted program and the backup trusted program;
the sending the data to be transmitted to the service trusted program includes:
and transmitting the sealed data plaintext to the service trusted program through the secure trusted channel.
27. The method of claim 26, wherein the verifying the business trusted program comprises:
the trusted execution environment of the service trusted program is verified, and fingerprint information of the service trusted program carried in a verification result is obtained;
the determining to-be-transmitted data associated with the service trusted program stored in the local trusted execution environment includes:
and determining the sealed data plaintext associated with the service trusted program in the local trusted execution environment according to the fingerprint information of the service trusted program.
28. The method of claim 25, wherein the determining data to be transmitted associated with the business trusted program stored in the local trusted execution environment comprises:
acquiring a recovery transmission public key of the service trusted program from a block chain;
decrypting a sealed data ciphertext in a local trusted execution environment to obtain a sealed data plaintext, and encrypting the sealed data plaintext according to the recovery transmission public key to obtain a recovery transmission ciphertext of the sealed data;
generating data to be transmitted comprising the recovery transmission ciphertext;
the sending the data to be transmitted to the service trusted program so that the service trusted program determines a corresponding sealed data plaintext according to the data to be transmitted includes:
and associating and chain-linking the data to be transmitted and the identification information of the service trusted program to store so as to obtain the data to be transmitted on the service trusted program chain, and decrypting the recovery transmission ciphertext according to the recovery transmission private key corresponding to the recovery transmission public key to obtain the sealed data plaintext.
29. The method according to claim 28, wherein the blockchain further stores therein remote verification information of the service trusted program generated based on hash data of the recovery transmission public key; the method further comprises the following steps:
according to the identification information of the service trusted program, acquiring remote verification information of the service trusted program generated based on Hash data of the recovery transmission public key from the block chain;
verifying the service trusted program according to the remote verification information of the service trusted program and the recovery transmission public key;
and if the verification is passed, triggering and executing the uplink storage operation of associating the data to be transmitted and the identification information of the service trusted program.
30. The method of claim 29, wherein the verifying the service trusted program according to the remote verification information of the service trusted program and the recovery transmission public key comprises:
and verifying the recovered transmission public key according to the hash data of the recovered transmission public key in the remote verification information of the service trusted program.
31. The method of claim 28, wherein the generating the data to be transmitted including the recovered transmission ciphertext comprises:
generating remote verification information of the backup trusted program according to the hash data of the recovery transmission ciphertext;
and generating the data to be transmitted, which comprises the recovery transmission ciphertext and the remote verification information of the backup trusted program, so that the business trusted program verifies the recovery transmission ciphertext according to the remote verification information of the backup trusted program.
32. An apparatus for storing a backup of data within a TEE, for execution by a service trusted program of a service machine, comprising:
a backup request acquisition module for acquiring a backup request; the backup request comprises identification information of a backup trusted program in a backup machine;
the to-be-transmitted data generation module is used for generating to-be-transmitted data according to an original ciphertext of the sealed data in the local trusted execution environment;
and the to-be-transmitted data sending module is used for sending the to-be-transmitted data to the backup trusted program according to the identification information of the backup trusted program, so that the backup trusted program determines a sealed data plaintext according to the to-be-transmitted data, and the sealed data plaintext and the service trusted program are subjected to associated encryption backup in a local trusted execution environment.
33. A backup device within a TEE for storing data for execution by a backup trusted program of a backup machine, comprising:
the data transmission device comprises a data acquisition module to be transmitted, a data transmission module and a data transmission module, wherein the data acquisition module to be transmitted is used for acquiring data to be transmitted; the data to be transmitted is generated by a service trusted program in a service machine according to an original ciphertext of sealed data in a local trusted execution environment, and is sent according to identification information of a backup trusted program in an acquired backup request;
the sealed data plaintext determining module is used for determining a sealed data plaintext according to the data to be transmitted;
and the associated encryption backup module is used for associating the sealed data plaintext with the service trusted program in a local trusted execution environment for encryption backup.
34. A device for restoring stored data within a TEE, for execution by a service trusted program of a restore machine, comprising:
a recovery request acquisition module for acquiring a recovery request; the recovery request comprises identification information of a backup trusted program in the backup machine;
the sealed data plaintext acquisition module is used for acquiring self-associated data to be transmitted from the backup trusted program according to the identification information of the backup trusted program and determining a corresponding sealed data plaintext according to the data to be transmitted;
and the sealed data plaintext storage module is used for encrypting and storing the sealed data plaintext into a local trusted execution environment.
35. A device for restoring stored data within a TEE, for execution by a backup trusted program of a backup machine, comprising:
the to-be-transmitted data determining module is used for determining to-be-transmitted data associated with the service trusted program stored in the local trusted execution environment;
and the to-be-transmitted data sending module is used for sending the to-be-transmitted data to the service trusted program so that the service trusted program determines a corresponding sealed data plaintext according to the to-be-transmitted data, and encrypts and stores the sealed data plaintext into a local trusted execution environment.
36. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of backing up data within a TEE of any of claims 1-9, and/or claims 10-16.
37. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of claims 17-24, and/or the method of any one of claims 25-31 for restoring data stored within a TEE.
38. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of backing up data within a TEE according to any one of claims 1-9, and/or claims 10-16.
39. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of recovering data within a TEE according to any of claims 17-24, and/or claims 25-31.
40. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of backing up data within a TEE of any of claims 1-9, and/or claims 10-16.
41. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of claims 17-24, and/or the method of recovering data within a TEE of any of claims 25-31.
CN202211023632.0A 2022-08-25 2022-08-25 Backup and recovery method, device, equipment and medium for TEE (trusted execution environment) internal storage data Active CN115129518B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211023632.0A CN115129518B (en) 2022-08-25 2022-08-25 Backup and recovery method, device, equipment and medium for TEE (trusted execution environment) internal storage data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211023632.0A CN115129518B (en) 2022-08-25 2022-08-25 Backup and recovery method, device, equipment and medium for TEE (trusted execution environment) internal storage data

Publications (2)

Publication Number Publication Date
CN115129518A true CN115129518A (en) 2022-09-30
CN115129518B CN115129518B (en) 2022-12-13

Family

ID=83387725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211023632.0A Active CN115129518B (en) 2022-08-25 2022-08-25 Backup and recovery method, device, equipment and medium for TEE (trusted execution environment) internal storage data

Country Status (1)

Country Link
CN (1) CN115129518B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115865305A (en) * 2022-11-23 2023-03-28 北京电子科技学院 Cross-platform signature stamp credibility generation and verification method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2759955A1 (en) * 2013-01-28 2014-07-30 ST-Ericsson SA Secure backup and restore of protected storage
CN111290884A (en) * 2020-02-19 2020-06-16 浙江口碑网络技术有限公司 Data backup method and device for cash register equipment
CN111814195A (en) * 2020-09-04 2020-10-23 支付宝(杭州)信息技术有限公司 Data management method, device and equipment based on trusted hardware

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2759955A1 (en) * 2013-01-28 2014-07-30 ST-Ericsson SA Secure backup and restore of protected storage
CN111290884A (en) * 2020-02-19 2020-06-16 浙江口碑网络技术有限公司 Data backup method and device for cash register equipment
CN111814195A (en) * 2020-09-04 2020-10-23 支付宝(杭州)信息技术有限公司 Data management method, device and equipment based on trusted hardware
CN113434849A (en) * 2020-09-04 2021-09-24 支付宝(杭州)信息技术有限公司 Data management method, device and equipment based on trusted hardware

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115865305A (en) * 2022-11-23 2023-03-28 北京电子科技学院 Cross-platform signature stamp credibility generation and verification method and system
CN115865305B (en) * 2022-11-23 2023-11-21 北京电子科技学院 Cross-platform signature seal credibility generation and verification method and system

Also Published As

Publication number Publication date
CN115129518B (en) 2022-12-13

Similar Documents

Publication Publication Date Title
US20220191012A1 (en) Methods For Splitting and Recovering Key, Program Product, Storage Medium, and System
WO2017206250A1 (en) Method and device for destroying backup of terminal
CN104579649A (en) Identity recognition method and system
CN109729000B (en) Instant messaging method and device
CN111741268B (en) Video transmission method, device, server, equipment and medium
CN115129518B (en) Backup and recovery method, device, equipment and medium for TEE (trusted execution environment) internal storage data
CN106130864B (en) A kind of private clound cut-in method and device based on VPN
CN106341226A (en) Data encryption and decryption method and system
US9756044B2 (en) Establishment of communication connection between mobile device and secure element
CN115473655B (en) Terminal authentication method, device and storage medium for access network
CN113778749B (en) Data backup method and electronic equipment
CN112987942B (en) Method, device and system for inputting information by keyboard, electronic equipment and storage medium
CN113051585B (en) Data verification method and device, electronic equipment and storage medium
CN115412547A (en) File uploading method and file uploading system
CN114884714A (en) Task processing method, device, equipment and storage medium
CN111814130B (en) Single sign-on method and system
CN114117404A (en) User authentication method, device, equipment, system and storage medium
CN114117471A (en) Confidential data management method, electronic device, storage medium, and program product
CN106598773B (en) Trusted system reduction apparatus
CN115543392B (en) Trusted program upgrading method, device, equipment and storage medium
CN112449143B (en) Implementation method and implementation system of secure video
CN115952527A (en) Data authorization, extraction and verification method, device, equipment and medium thereof
CN116578479A (en) Test synchronization method, device, electronic equipment and medium
CN115964720A (en) Confidential calculation method, device, equipment and medium based on FaaS platform
CN115357919A (en) Data processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant