CN115348023A - Data security processing method and device - Google Patents

Data security processing method and device Download PDF

Info

Publication number
CN115348023A
CN115348023A CN202110529515.0A CN202110529515A CN115348023A CN 115348023 A CN115348023 A CN 115348023A CN 202110529515 A CN202110529515 A CN 202110529515A CN 115348023 A CN115348023 A CN 115348023A
Authority
CN
China
Prior art keywords
public key
key
tee
encrypted
data
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.)
Pending
Application number
CN202110529515.0A
Other languages
Chinese (zh)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202110529515.0A priority Critical patent/CN115348023A/en
Publication of CN115348023A publication Critical patent/CN115348023A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements

Abstract

The embodiment of the application provides a data security processing method and device, relates to the field of IT technology, and can ensure the security of data between a user and a trusted computing environment and ensure the security of data input into the trusted computing environment. The specific scheme is as follows: the TEE can be used for generating an encrypted public key and a public key certificate when receiving a key request from the electronic equipment, and sending the encrypted public key and the public key certificate to the electronic equipment; the electronic equipment can be used for encrypting data according to the encryption public key when the public key certificate passes the verification according to the signing public key acquired from the authentication server, and sending the encrypted data to the TEE; TEE, which may also be used to decrypt encrypted data. The embodiment of the application is used for the communication process between the user and the trusted computing environment.

Description

Data security processing method and device
Technical Field
The embodiment of the present application relates to the Information Technology (IT) Technology field, and in particular, to a data security processing method and apparatus.
Background
The core technology of secure computing and trusted computing is data isolation, i.e., protecting a user's data from being accessed by other entities (including supervisors such as administrators). The software and hardware basis for providing data isolation to secure computing data constitutes a trusted computing environment into which data entering the environment may be considered secure, within which computing processes may be considered trusted.
A typical Trusted computing Environment is a Trusted Execution Environment (TEE). The TEE may be understood as dividing independent trusted zones in a Central Processing Unit (CPU) and a memory and isolating running environments of different virtual machines or programs, preventing the different virtual machines or programs from accessing data of each other, even if the virtual machines or programs with higher authority levels cannot access across boundaries. Currently, typical technologies in the IT industry are software protection extensions (SGX) and trust domain extensions (TDX) of Intel (Intel), which can provide data isolation at the program application and virtual machine levels, and provide supporting technologies such as memory encryption and integrity protection. However, these techniques mainly focus on data isolation encryption, key distribution management, and the like of multiple computing tasks inside a trusted computing environment, that is, a TEE can ensure that data is safe after entering the TEE, but the security of an input/output (I/O) channel between data from a user to the TEE is not guaranteed. Even if the data sent by the user to the TEE is in a ciphertext state, the TEE needs to decrypt the ciphertext to obtain the data when receiving the data, the key for obtaining the ciphertext by encrypting the data is distributed based on a third party, the key distributed by the third party still has the risk of leakage, in short, an I/O channel of the data in the transmission process between the user and the TEE is not guaranteed, and the risk of leakage still exists in the data.
Disclosure of Invention
The embodiment of the application provides a data security processing method and device, which can ensure the security of data transmission between a user and a trusted computing environment.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, a communication system is provided, the secure communication system comprising a trusted execution environment TEE, an electronic device, and an authentication server, wherein: the TEE can be used for generating an encrypted public key and a public key certificate when receiving a key request from the electronic equipment, and sending the encrypted public key and the public key certificate to the electronic equipment; the electronic equipment can be used for encrypting data to be sent according to the encryption public key when the public key certificate passes the verification according to the signature verification public key acquired from the authentication server, and sending the encrypted data to the TEE; the TEE may also be used to decrypt encrypted data.
It is to be appreciated that when the electronic device communicates with the TEE, the encryption public key that the electronic device encrypts the data is generated by the TEE. When the electronic equipment passes the verification of the public key certificate according to the signature verification public key acquired from the authentication server, the fact that the encryption public key received by the electronic equipment from the TEE is legal is indicated, and when the electronic equipment has data to be sent to the TEE, the data can be encrypted by using the encryption public key generated by the TEE to obtain encrypted data and then the encrypted data is transmitted to the TEE. Therefore, the data to be sent by the electronic equipment can be sent to the TEE through the safe I/O channel between the electronic equipment and the TEE, namely, the safety of the data in transmission in the I/O channel before entering the TEE is ensured. Moreover, the encryption public key used by the electronic device for encrypting the data is generated by the TEE and sent to the electronic device, so that the risk of key leakage caused by the fact that a third party distributes the encryption public key in the prior art can be avoided.
In one possible design, the TEE may be specifically used to: when a key request is received, generating an encrypted public key, a decrypted private key and a public key certificate; TEE may be used specifically for: and decrypting the encrypted data according to the decryption private key. That is, the encrypted public key of the present application is generated by the TEE, and the key sent to the electronic device includes a public key certificate for verifying the encrypted public key. When the electronic device verifies that the public key certificate is legal, the electronic device can encrypt the data to be transmitted by using the encryption public key. The decryption private key is held in the TEE, and the TEE can decrypt the received encrypted data according to the decryption private key. In this way, the I/O channel of data before entering the TEE may be secured.
In one possible design, the electronic device may be specifically configured to: when the public key certificate is confirmed to pass verification, a session key is generated, and the session key is encrypted according to the encryption public key to obtain an encryption key; encrypting data to be sent according to the session key to obtain encrypted data; sending the encrypted data and the encryption key to the TEE; TEE is specifically used for: decrypting the encrypted key according to the decryption private key to obtain a session key; the encrypted data is decrypted based on the session key.
It can be understood that, after the electronic device verifies the validity of the encryption public key, the electronic device may not need to ask for a new encryption public key from the TEE before sending data to the TEE each time, but may use the encryption public key to encrypt the session key generated by the electronic device itself and then obtain the encryption key to send to the TEE, and the TEE may use the decryption private key to decrypt the encryption key to obtain the session key. The session key may be understood as a symmetric key, i.e. the electronic device may encrypt data using the session key, and the TEE may decrypt received encrypted data using the session key. Therefore, for a scene with a large input amount of the electronic equipment to the TEE, the communication efficiency between the electronic equipment and the TEE can be improved.
In one possible design, the TEE may be specifically used to: signing the encrypted public key according to the signature verification private key of the TEE to generate a public key certificate; the electronic device is specifically configured to: sending an identification of the TEE to an authentication server; the authentication server is used for acquiring the signature verification public key and the signature verification certificate corresponding to the TEE identifier and sending the signature verification public key and the signature verification certificate to the electronic equipment; the electronic device is specifically configured to: and verifying the signature verification public key according to the signature verification certificate, and when the verification is passed, determining that the signature verification public key is legal, wherein the signature verification public key is legal and comprises a signature verification public key and a signature verification private key which correspond to each other.
That is to say, after obtaining the encryption public key and the public key certificate from the TEE, the electronic device can obtain the signature verification public key and the signature verification certificate corresponding to the TEE from the authentication server, and after verifying the signature verification public key by using the signature verification certificate, the signature verification public key can be used to verify the public key certificate, and when the verification passes, the encryption public key is legal, and the encryption public key can be used to encrypt data, thereby ensuring the safety of data transmission on the I/O channel between the electronic device and the TEE.
In a second aspect, a secure communication method is provided, which may include: when a trusted execution environment TEE receives a key request from electronic equipment, the TEE generates an encrypted public key and a public key certificate and sends the encrypted public key and the public key certificate to the electronic equipment; and when the electronic equipment passes the verification of the public key certificate according to the signature verification public key acquired from the authentication server, encrypting the data to be transmitted according to the encryption public key, and transmitting the encrypted data to the TEE so that the TEE can decrypt the encrypted data.
The advantageous effects of the second aspect can be seen from the description of the first aspect.
In one possible design, the TEE generating the encrypted public key and the public key certificate includes: the TEE generates an encryption public key, a decryption private key and a public key certificate; the TEE decrypting the encrypted data includes: the TEE decrypts the encrypted data according to the decryption key.
In one possible design, encrypting the data according to the encryption public key, and sending the encrypted data to the TEE includes: generating a session key, and encrypting the session key according to the encryption public key to obtain an encryption key; encrypting data to be sent according to the session key to obtain encrypted data; sending the encrypted data and the encryption key to the TEE; the TEE decrypting the encrypted data includes: the TEE decrypts the encryption key according to the decryption private key to obtain a session key; the encrypted data is decrypted based on the session key.
In one possible design, the TEE generating the encrypted public key and the public key certificate includes: the TEE generates an encrypted public key, and signs the encrypted public key according to a signature verification private key of the TEE to generate a public key certificate; the method further comprises the following steps: the electronic equipment sends the identification of the TEE to an authentication server; the authentication server acquires a signature verification public key and a signature verification certificate corresponding to the TEE identifier and sends the signature verification public key and the signature verification certificate to the electronic equipment; and the electronic equipment verifies the signature verification public key according to the signature verification certificate, and when the verification is passed, the validity of the signature verification public key is determined, wherein the validity of the signature verification public key comprises correspondence of the signature verification public key and the signature verification private key.
In a third aspect, a trusted execution environment, TEE, is provided, which may include: the input/output I/O module is used for receiving a key request from the electronic equipment and sending the key request to the key generation module; the key generation module is used for generating an encrypted public key and sending the encrypted public key to the I/O module; the I/O module is also used for sending the encrypted public key to the certificate generating module; the certificate generating module is used for generating a public key certificate according to the encrypted public key; the public key certificate is used for verifying the encrypted public key by the electronic equipment; sending a public key certificate to the I/O module; the I/O module is also used for sending the encrypted public key and the public key certificate to the electronic equipment; the I/O module is also used for receiving the encrypted data from the electronic equipment so as to decrypt the encrypted data; the encrypted data is obtained by encrypting the data by the electronic equipment according to the encryption public key.
The advantageous effects of the third aspect can be seen from the description of the first aspect.
In one possible design, the key generation module is specifically configured to: generating an encrypted public key, a decrypted private key and a public key certificate; the I/O module is specifically configured to: and decrypting the encrypted data according to the decryption private key.
In one possible design, the I/O module is specifically configured to: receiving an encryption key and encryption data from the electronic equipment, wherein the encryption key is obtained by encrypting a session key generated by the electronic equipment according to an encryption public key by the electronic equipment; the encrypted data is obtained by encrypting data to be sent by the electronic equipment according to the session key; decrypting the encrypted key according to the decryption private key to obtain a session key; the encrypted data is decrypted based on the session key.
In one possible design, the certificate generation module is specifically configured to: and signing the encrypted public key according to the signature verification private key of the TEE to generate a public key certificate.
In a fourth aspect, a method for secure data communication is provided, which may include: generating an encrypted public key upon receiving a key request from an electronic device; generating a public key certificate according to the encrypted public key; the public key certificate is used for verifying the encrypted public key by the electronic equipment; sending the encrypted public key and the public key certificate to the electronic equipment; receiving encrypted data from the electronic device to decrypt the encrypted data; the encrypted data is obtained by encrypting the data by the electronic equipment according to the encryption public key.
The advantageous effects of the fourth aspect can be seen from the description of the first aspect.
In one possible design, generating the cryptographic public key includes: generating an encryption public key and a decryption private key; decrypting the encrypted data includes: and decrypting the encrypted data according to the decryption private key.
In one possible design, receiving the encrypted data from the electronic device to decrypt the encrypted data includes: receiving an encryption key and encryption data from the electronic equipment, wherein the encryption key is obtained by encrypting a session key generated by the electronic equipment according to an encryption public key by the electronic equipment; the encrypted data is obtained by encrypting data to be sent by the electronic equipment according to the session key; decrypting the encrypted key according to the decryption private key to obtain a session key; the encrypted data is decrypted based on the session key.
In one possible design, generating the public key certificate from the encrypted public key includes: and signing the encrypted public key according to the signature verification private key of the TEE to generate a public key certificate.
In a fifth aspect, a communication apparatus is provided, where a communication device includes a transceiver and a processor; a transceiver for receiving a key request from an electronic device; a processor for generating an encrypted public key; generating a public key certificate according to the encrypted public key; the public key certificate is used for verifying the encrypted public key by the electronic equipment; the transceiver is also used for sending the encrypted public key and the public key certificate to the electronic equipment; a transceiver further configured to receive encrypted data from the electronic device to decrypt the encrypted data; the encrypted data is obtained by encrypting the data to be sent by the electronic equipment according to the encryption public key.
The advantageous effects of the fifth aspect can be seen from the description of the first aspect.
In one possible design, the processor is specifically configured to: generating an encrypted public key, a decrypted private key and a public key certificate; the processor is further configured to: and decrypting the encrypted data according to the decryption private key.
In one possible design, the transceiver is specifically configured to: receiving an encryption key and encrypted data from the electronic equipment, wherein the encryption key is obtained by encrypting a session key generated by the electronic equipment according to an encryption public key by the electronic equipment; the encrypted data is obtained by encrypting data to be sent by the electronic equipment according to the session key; the processor is specifically configured to: decrypting the encrypted key according to the decryption private key to obtain a session key; the encrypted data is decrypted based on the session key.
In one possible design, the processor is specifically configured to sign the encrypted public key according to a signature verification private key of the TEE, and generate a public key certificate.
A sixth aspect provides a computer-readable storage medium comprising computer instructions which, when executed on an electronic device, cause the electronic device to perform the method of any one of the possible designs of the fourth aspect and the fourth aspect.
In a seventh aspect, a computer program product is provided, which, when run on a computer, causes the electronic device to perform the method of any of the possible designs of the fourth aspect and the above-mentioned fourth aspect.
In an eighth aspect, a method for processing data safely is provided, which includes: the electronic equipment sends a key request to a Trusted Execution Environment (TEE), wherein the key request is used for requesting an encryption public key for encrypting data to be sent; the electronic equipment receives the encrypted public key and the public key certificate sent by the TEE, encrypts data to be sent according to the encrypted public key when the public key certificate passes verification according to the signature verification public key acquired from the authentication server, and sends the encrypted data to the TEE.
Therefore, when the electronic equipment sends data to the TEE on the I/O channel, the electronic equipment can encrypt the data by using the encryption public key which is sent by the TEE and is verified by the electronic equipment, and the encrypted data is obtained. Because the encryption public key of the encrypted data is distributed by the TEE, the leakage risk caused by the distribution of the encryption public key by a third party can be avoided, and the safety of the data transmitted on an I/O channel between the electronic equipment and the TEE is ensured.
In one possible design, encrypting data to be transmitted according to the encryption public key, and transmitting the encrypted data to the TEE includes: generating a session key, and encrypting the session key according to the encryption public key to obtain an encryption key; encrypting data to be sent according to the session key to obtain encrypted data; the electronic device sends the encrypted data and the encryption key to the TEE. In this way, the TEE can decrypt the encryption key using the decryption private key to obtain the session key, and thus decrypt the encrypted data according to the session key to obtain the plaintext data. Therefore, the electronic equipment and the TEE can use the session key to encrypt and decrypt data, and when the data transmission volume is large, the electronic equipment and the TEE do not need to apply for a new encryption public key and verify the encryption public key every time.
In one possible design, the method further includes: the electronic equipment requests an authentication public key and an authentication certificate corresponding to the TEE from the TEE, and then receives the authentication public key and the authentication certificate corresponding to the TEE sent by the authentication server; and verifying the signature verification public key according to the signature verification certificate, and when the verification is passed, the electronic equipment determines that the signature verification public key is legal. In this way, the electronic device can further verify the public key certificate using the signature verification public key.
In a ninth aspect, an electronic device is provided, which includes: the receiving and sending module is used for sending a key request to the trusted execution environment TEE, wherein the key request is used for requesting an encryption public key for encrypting data to be sent; the receiving and sending module is also used for receiving the encrypted public key and the public key certificate sent by the TEE; the processing module is used for encrypting the data to be sent according to the encryption public key when the public key certificate passes the verification of the signature verification public key acquired from the authentication server to obtain encrypted data; and the transceiver module is also used for sending the encrypted data to the TEE.
In one possible design, the processing module is configured to generate a session key, and encrypt the session key according to the encryption public key to obtain an encryption key; encrypting data to be sent according to the session key to obtain encrypted data; and the transceiver module is used for sending the encrypted data and the encryption key to the TEE.
In one possible design, the transceiver module is used for requesting the signature verification public key and the signature verification certificate corresponding to the TEE from the TEE and then receiving the signature verification public key and the signature verification certificate corresponding to the TEE sent by the authentication server; and the processing module is used for verifying the signature verification public key according to the signature verification certificate and determining that the signature verification public key is legal when the verification is passed.
In a tenth aspect, there is provided an electronic device comprising: the device comprises a transceiver and a Trusted Execution Environment (TEE), wherein the transceiver is used for sending a key request to the TEE, and the key request is used for requesting an encryption public key for encrypting data to be sent; the transceiver is also used for receiving the encrypted public key and the public key certificate sent by the TEE; the processor is used for encrypting the data to be sent according to the encryption public key when the public key certificate passes the verification of the signature verification public key acquired from the authentication server to obtain encrypted data; a transceiver further configured to send the encrypted data to the TEE.
In one possible design, the processor is configured to generate a session key, and encrypt the session key according to the encryption public key to obtain an encryption key; encrypting data to be sent according to the session key to obtain encrypted data; a transceiver to transmit the encrypted data and the encryption key to the TEE.
In one possible design, the transceiver is used for requesting the signature verification public key and the signature verification certificate corresponding to the TEE from the TEE and then receiving the signature verification public key and the signature verification certificate corresponding to the TEE sent by the authentication server; and the processor is used for verifying the signature verification public key according to the signature verification certificate and determining that the signature verification public key is legal when the verification is passed.
In an eleventh aspect, a computer-readable storage medium is provided, which includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method according to any one of the above-mentioned eighth aspect and possible designs of the eighth aspect.
In a twelfth aspect, a computer program product is provided, which, when run on a computer, causes the electronic device to perform the method according to any one of the above-mentioned eighth and eighth possible designs.
Drawings
FIG. 1 is a schematic diagram of a trusted computing arrangement and a confidential computing arrangement provided by an embodiment of the present application;
fig. 2 is a schematic diagram of a network architecture according to an embodiment of the present application;
fig. 3 is a schematic view of a scenario of communication between a user and a TEE according to an embodiment of the present application;
fig. 4 is a communication flow diagram of a secure communication system according to an embodiment of the present application;
fig. 5 is a communication flow diagram of a secure communication system according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a TEE provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a communication device according to an embodiment of the present application.
Detailed Description
For ease of understanding, examples are given in part to illustrate concepts related to embodiments of the present application. As follows:
TEE: it is understood to be a secure area within the CPU, i.e. the TEE runs in a separate environment and in parallel with the operating system. The CPU may ensure that the confidentiality and integrity of both code and data in the TEE are protected. By using both hardware and software to protect data and code, i.e., a TEE can be understood as a relatively secure software and hardware environment, a TEE is more secure than an operating system. Trusted applications running in the TEE can access the full functionality of the device's main processor and memory, while hardware isolation protects the TEE's components from user-installed applications running in the main operating system.
Safety I/O: can be understood as a protected path between a computer user and the software interacting with the user. In current computer systems, there are many ways malware intercepts data transmitted between a user and a software process. The safety I/O is represented by a channel protected and verified by hardware and software, and the verification value is adopted to verify that the software for input and output is not tampered, so that malicious software injected between I/O channels can be identified.
As shown in fig. 1, in the existing trusted computing scheme, data sent by a user may be encrypted to form ciphertext data, which is input into an Application (APP)/service for processing, and the application/service may decrypt the ciphertext data to obtain a ciphertext result, but in this scheme, a key used for encryption is mostly allocated to the user and the application/service by a third party, and the key has a risk of leakage. In another secret computing scheme, when ciphertext data sent by a user is input into an application/service for processing, the application/service is in a hardware security execution environment, that is, the ciphertext data is processed in a separate trusted region. In this scheme, although the ciphertext data is safe when entering the secure execution environment for processing, the key of the ciphertext data is still distributed by a third party, and the ciphertext data still has the risk of leakage in an I/O channel through which the user sends the ciphertext data to the secure execution environment.
In the two schemes, the data sent by the user to the application/service may be private data of a single user, or private data of multiple users. In addition, the user may also send privacy-related algorithms of the multi-party user to the application/service.
In another trusted computing scheme in a TEE, encryption and decryption of data may be performed with the TEE certified using remote certification (remote attestation). The remote attestation requires the TEE to measure its configuration state and issue a measurement result in the form of a signed certificate, providing a measurement attestation to a user outside the TEE, the user determining from the measurement attestation whether the measurement result is authentic. The method specifically comprises the following steps: the TEE uses a signature private Key-sig built in when the TEE leaves the factory to issue a measurement result (which can be understood as a configuration state of the TEE), and obtains a measurement certificate (remote certificate). Then, the TEE sends the measurement proof to the user; the user can obtain a verification public Key Key-ver and a public Key certificate Key-cer corresponding to the TEE from the authentication server, (the public Key certificate Key-cer is generally issued by a most basic authority (the verification public Key Key-ver is signed by an authority private Key Key-aut to generate the public Key certificate Key-cer), for example, under an Intel SGX/TDX system, intel provides a public Key certificate service for a trusted computing (execution) environment under the user's flag.
Based on this, the application provides a communication system and a data security communication method, which can be applied to a communication scene between a user and a TEE, and can provide a secret key for the user through the TEE, and after the user verifies that the secret key is legal, the user can encrypt data by using the secret key so as to transmit the encrypted data in an I/O channel between the user and the TEE.
It should be noted that, in the present application, the data communicated between the user and the TEE may also include data or code data corresponding to the algorithm model.
In the application, a decryption private key generated by the TEE is mastered in the TEE, and a generated encryption public key is sent to a user, namely, the public key used for encrypting data is also generated by the TEE, and third party key management is not introduced, so that the trust problem and potential safety hazard of a third party can be avoided. In the key verification and authentication of the application, when the TEE generates a decryption private key and issues an encryption public key to a user, a public key certificate of the encryption public key needs to be issued to the user by an authentication private key of the TEE, and the authentication private key of the TEE also needs higher-level authentication (an authentication certificate provided by an authentication server mentioned below in the application) to ensure the reliability of the encryption public key sent by the TEE.
After the authenticity of the encryption public key of the TEE is proved, the user can encrypt data by using the encryption public key and then carry out encryption communication with the TEE.
As shown in fig. 2, the network architecture of the present application may include a TEE-enabled server 21, an electronic device 22, and an authentication server 23. The network architecture can be understood as a secure communication system. Wherein, the electronic device 22 can perform encrypted communication with the TEE-supporting server 21, and before the communication, the electronic device 22 can acquire the signature verification public key and the signature verification certificate for verifying the authenticity of the TEE, or acquire verification information for confirming the authenticity of the encrypted public key of the encrypted communication, from the authentication server 23.
Wherein, the server 21 supporting TEE may be a cloud server; the authentication server 23 may be configured to store authentication information, for example, store a signature verification public key and a signature verification certificate corresponding to the TEE, and when the user makes an authentication request, the authentication server is responsible for responding; the electronic equipment 22 may be terminal equipment, a server, user Equipment (UE), an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, mobile equipment, a user terminal, a terminal, wireless communication equipment, a user agent, or user equipment. The electronic device in the embodiment of the present application may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a wireless transceiving function, a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote medical (remote medical), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), a terminal device in 5G network, or a terminal device in Public Land Mobile Network (PLMN) for future evolution, and the like. The embodiments of the present application do not limit the application scenarios. The methods and steps implemented by the electronic device in the present application may also be implemented by components (e.g., chips or circuits) and the like that are available to the electronic device. In the present application, the electronic device and a component (e.g., a chip or a circuit) that can be provided in the electronic device are collectively referred to as an electronic device.
With the above network architecture, in the present application, after a user (electronic device) obtains an encryption public key provided by the TEE and determines the reliability of the encryption public key, there are various scenarios for performing encryption communication between the TEE and the encryption public key provided by the TEE, for example, as shown in fig. 3, (1) in fig. 3 shows an encryption communication process of private data between a data provider (single user) and the TEE. And when the user 1 encrypts the data x by using the encryption public key, ciphertext data is obtained and sent to the TEE. The TEE can be used for decrypting the ciphertext data according to a decryption private key provided by the TEE on the CPU occupied by the TEE to obtain data x, namely decrypted plaintext, and then the TEE can be used for calculating x, namely f (x), namely plaintext calculation. Then, the TEE can feed back the calculation result f (x) to the user through encrypted communication; fig. 3 (2) shows an encrypted communication process of private data between multiple users and the TEE. After the user 1 encrypts the data x1 by using the encryption public key 1, ciphertext data 1 is obtained, and the subsequent processing process is similar to the process of (1) in fig. 3; after encrypting the data x2 by using the encryption public key 2, the user 2 obtains ciphertext data 2, and the subsequent processing process is also similar to the process of (1) in fig. 3; fig. 3 (3) shows that multiple users perform encryption communication of the algorithm model and data with the TEE, the user 1 may encrypt the algorithm model f () using the encryption public key, obtain a private algorithm model, send the private algorithm model to the TEE, and the TEE decrypts the private algorithm model to obtain the algorithm model f (), and stores the algorithm model. Fig. 3 (3) also shows the process of the user 2 performing encrypted communication on the data x1, and the user 3 performing encrypted communication on the data x2 (similar to fig. 3 (2)), which is not described in detail herein.
Of course, the secure communication process between the user and the TEE provided by the present application is not limited to the various scenarios shown in fig. 3, and may also be applied to other scenarios.
With the above network architecture and application scenario, the following introduces a communication flow of the secure communication system provided in the present application, as shown in fig. 4, the communication flow of the present application may include:
401. the electronic device verifies that the TEE to be communicated with the electronic device is passing.
For example, the electronic device verifies and accepts the TEE interacting with the electronic device through the remote attestation techniques described above.
402. The electronic device sends a key request to the TEE, the key request requesting key information for encrypting data.
When the electronic device has data to send to the TEE, an encryption public key for encrypting the data may be requested from the TEE first, so that after the encryption public key is verified, the data is encrypted using the encryption public key.
403. The TEE generates an encrypted public key and a public key certificate upon receiving a key request from the electronic device.
When a key request is received, the TEE can generate an encrypted public key and a decrypted private key, and then the encrypted public key is signed according to the signature verification private key of the TEE to generate a public key certificate.
For example, when the TEE receives the Key request and determines that the electronic device is to send data to the TEE, an encryption/decryption Key pair may be randomly generated, where the encryption/decryption Key pair includes an encryption public Key-enc and a decryption private Key-dec. The encryption public Key Key-enc is used for encrypting data by the electronic equipment, and the decryption private Key Key-dec is used for the TEE to decrypt the received encrypted data to obtain decrypted data.
After the encrypted public Key-enc is generated, in order to verify the validity of the encrypted public Key-enc for a subsequent user, the TEE needs to Sign the encrypted public Key-enc according to a unique signature verification private Key-sig built in the TEE, so as to generate a public Key certificate Cer (such as Cer = Sign (Key-sig, key-enc)).
404. The TEE sends a key response to the electronic device, the key response including the encrypted public key and the public key certificate.
That is, the Key response may include the above-described encrypted public Key-enc and the public Key certificate.
405. The electronic device sends an authentication request to an authentication server, the authentication request including an identification of the TEE.
After the electronic device receives the encrypted public Key-enc and the public Key certificate, the electronic device may send an authentication request to an authentication server in order to verify the validity of the encrypted public Key-enc, where an identifier of the TEE in the authentication request may be, for example, a unique serial number of the TEE.
406. And the authentication server acquires the signature verification public key and the signature verification certificate corresponding to the TEE identifier.
For example, the authentication server may store a signature verification public Key-ver and a signature verification certificate Key-cer corresponding to serial numbers (one type of identifiers) of multiple TEEs, and the authentication server may obtain the signature verification public Key-ver and the signature verification certificate Key-cer corresponding to the serial numbers according to the serial numbers of the TEEs sent by the user.
The signature verification certificate Key-cer can be regarded as a signature result of the signature verification private Key Key-sig on the signature verification public Key Key-ver, and is used for proving the legality of the signature verification public Key Key-ver. Or the signature verification public Key-ver corresponding to the signature verification private Key-sig of the TEE is stored in the authentication server.
407. The authentication server sends an authentication response to the electronic equipment, wherein the authentication response comprises a signature verification public key and a signature verification certificate.
Namely, the authentication response comprises a signature verification public Key-ver and a signature verification certificate Key-cer corresponding to the sequence number of the TEE.
408. And when the electronic equipment determines that the signature verification public key is legal according to the signature verification certificate, verifying the public key certificate according to the signature verification public key.
The electronic equipment can verify the signature verification public key according to the signature verification certificate, and when the verification is passed, the validity of the signature verification public key is determined, wherein the validity of the signature verification public key comprises the correspondence of the signature verification public key and the signature verification private key. And then, the electronic equipment verifies the public key certificate according to the signature verification public key so as to determine whether the public key certificate is legal or not, and the purpose of verifying whether the public key certificate is legal or not is to verify the validity of the encrypted public key received by the electronic equipment.
For example, since the signature verification public Key-ver may occur during transmission, when the electronic device receives the signature verification public Key-ver and the signature verification certificate Key-cer, the electronic device may verify the signature verification public Key-ver according to the signature verification certificate Key-cer, for example, an algorithm for verifying the signature verification public Key-ver may be as follows: and when the result of the Verify (Key-cer, key-ver) indicates that the signature verification public Key-ver is legal, the signature verification public Key-ver is a public Key corresponding to the signature verification private Key-sig stored in the TEE, namely the signature verification private Key-sig and the signature verification public Key-ver are a pair of keys.
When the electronic equipment verifies that the signature verification public Key-ver is legal, the electronic equipment can verify a public Key certificate Cer = Sign (Key-sig, key-enc) through the signature verification public Key-ver, and the purpose of verifying the public Key certificate Cer is to verify whether an encrypted public Key-enc received by the electronic equipment when receiving the public Key certificate Cer is legal or not. For example, an algorithm for verifying the public key certificate Cer may be exemplified as: verify (Key-ver, cer), when the result of Verify (Key-ver, cer) indicates that the public Key certificate Cer is legal, the electronic device determines that the received encrypted public Key-enc is legal.
409. And when the electronic equipment determines that the public key certificate passes verification, encrypting the data according to the encrypted public key to obtain encrypted data.
Step 408 already indicates that when it is determined that the public Key certificate Cer is legal, the encryption public Key-enc received by the electronic device from the TEE is legal, and then the electronic device may encrypt the data to be sent by using the encryption public Key-enc to obtain encrypted data, or obtain ciphertext data.
410. The electronic device sends the encrypted data to the TEE.
For example, the electronic device sending the encrypted data may be exemplified by: input = Encrypt (Key-enc, data).
411. And the TEE decrypts the encrypted data to obtain decrypted data.
Illustratively, when receiving encrypted Data Encrypt (Key-enc, data), the TEE may decrypt the Encrypt (Key-enc, data) using a decryption private Key-dec corresponding to the encryption public Key-enc to obtain Data. The algorithm for decryption using the decryption private Key-dec may be exemplified by: decrypt (Key-dec, input).
Thus, considering that the encrypted data of the I/O channel of the electronic device inputting data to the TEE in the prior art is distributed by a third party, there is a risk of leakage. The encryption public key and the decryption private key can be generated by the TEE, and the encryption public key and a public key certificate used for verifying the encryption public key are sent to the electronic equipment, wherein the public key certificate is signed by the signature verification private key of the TEE. The electronic equipment can obtain the signature verification public key and the signature verification certificate of the verification public key certificate through the authentication server, and when the electronic equipment verifies that the signature verification public key is legal through the signature verification certificate, the signature verification public key corresponds to the signature verification private key of the TEE. The electronic equipment can further verify the public key certificate through the signature verification public key, when the verification is passed, the encryption public key received by the electronic equipment and sent together with the public key certificate is legal, the electronic equipment can use the encryption public key to encrypt or treat the sent data, and the TEE can use the decryption private key to decrypt the received encrypted data. That is, the user may verify the validity of the encryption key obtained from the TEE to verify the security of the I/O channel between the user and the TEE. Because the encryption public key for data encryption is generated by the TEE and sent to the electronic equipment, the secret key distribution of a third party does not exist, the safety of the private data of the user and the like when the private data and the like are injected into the TEE can be ensured, the safe I/O channel between the user and the TEE is realized, and the input safety is ensured.
It is to be understood that, in step 403, the encryption public key and the decryption private key generated by the TEE may be understood as a pair of asymmetric keys, i.e., the encryption public key and the decryption private key are different. However, in this case, the electronic device needs to perform steps 402 to 411 once each time data communication is performed with the TEE, and data processing efficiency is low. Therefore, the present application also provides a more concise data encryption and data decryption method, and when the electronic device verifies that the public Key certificate passes the verification in step 409, it has been described that the encrypted public Key-enc received by the electronic device is legal. In order to improve the communication efficiency between the electronic device and the TEE, as shown in fig. 5, steps 409 to 411 may be replaced by steps 409a to 412a:
409a, when the electronic equipment determines that the public key certificate passes verification, generating a session key, and encrypting the session key according to the encryption public key to obtain an encryption key.
For example, when the electronic device determines that the public Key certificate Cer is legal, if the input amount of the user to the TEE is large, the electronic device may randomly generate a session Key-com. The session Key-com can be understood as a symmetric Key such as Advanced Encryption Standard (AES). Then, the session Key-com is encrypted by using the encryption public Key-enc, and the result of obtaining the encryption Key may be exemplified as: encrypt (Key-enc, key-com).
410a, the electronic device encrypts the data to be sent according to the session key to obtain encrypted data.
For example, the electronic device encrypts data to be transmitted by using the session Key-com, and the obtained encrypted data may be exemplified as: encrypt (Key-com, data).
411a, the electronic device sends the encrypted data and the encryption key to the TEE.
That is, the electronic device transmits the result Input1= Encrypt (Key-enc, key-com) of encrypting the session Key and the result Input2= Encrypt (Key-com, data) of encrypting the Data to the TEE together.
412a, the TEE decrypts the encryption key according to the decryption private key to obtain a session key; the encrypted data is decrypted based on the session key.
Since the decryption private Key, key-dec, is the corresponding Key of the encryption public Key, key-enc, the TEE, upon receiving the result Encrypt of the encryption Key (Key-enc, key-com), the encryption Key can be decrypted by using the decryption private Key-dec to obtain the session Key-com. Key-com may be exemplified by Key-com = Decrypt (Key-dec, input 1).
The TEE may then decrypt the encrypted data using the session Key-com. When the encrypted data is the result of encryption of the data, the TEE decrypting the encrypted data according to the session Key-com may be exemplified as: data = Decrypt (Key-com, input 2).
Therefore, when the electronic device establishes session connection with the TEE, the electronic device does not need to request the TEE to generate an encryption public key before sending data each time, and after the encryption public key is verified, the encryption public key is used for encrypting the data, the TEE uses a decryption private key for decrypting the encrypted data, but after the encryption public key is verified, the randomly generated session key is encrypted by using the encryption public key to obtain an encryption key which is sent to the TEE, and the TEE can decrypt the encryption key according to the decryption private key to obtain the session key. For the electronic device, each time the electronic device sends data, the electronic device may encrypt the data using the session key to obtain encrypted data, and the TEE may also decrypt the encrypted data using the session key, that is, the session key may be understood as a symmetric key. Of course, the TEE may also encrypt data to be sent by the TEE using the session key and send the encrypted data to the electronic device, and the electronic device then decrypts the received encrypted data using the session key. Therefore, the authenticated session key can be used for ensuring the two-way safe communication with the TEE, and the electronic equipment can be supported to encrypt a large amount of data to be input directly according to the session key, so that the communication efficiency is improved.
Based on the secure communication method shown in fig. 4 and fig. 5, the present application provides a trusted execution environment TEE corresponding to the method, and when the TEE is used to implement the process in the above method steps, as shown in fig. 6, the TEE may include: an I/O module 601, a key generation module 602, and a certificate generation module 603.
The I/O module 601 may be configured to receive a key request from an electronic device;
here an implementation of the I/O module 601 may be used to perform the subtended process of step 402 described above.
A key generation module 602, configured to generate an encrypted public key;
in some embodiments, the key generation module 602 may be configured to generate an encrypted public key and a decrypted private key, and the specific implementation may refer to the description of step 403. The key generation module 602 may be understood as a key generation.
The key generation module 602 may then be configured to send the encrypted public key to the I/O module 601 for sending the encrypted public key to the certificate generation module 603 via the I/O module 601.
It should be noted that, when the key generation module 602 is configured to send the encrypted public key to the I/O module 601, MAC information generated by using the encrypted public key and the encrypted public key may be sent to the I/O module 601, where the MAC information may be understood as digest information of the encrypted public key. Then, the I/O module 601 sends the MAC information to the certificate generation module 603.
A certificate generating module 603, configured to generate a public key certificate according to the encrypted public key; the public key certificate is used for verifying the encrypted public key by the electronic equipment;
in some embodiments, the certificate generation module 603 may be specifically configured to: and signing the encrypted public key according to the signature verification private key of the TEE to generate a public key certificate. The specific implementation manner of the certificate generating module 603 generating the public key certificate according to the encrypted public key can refer to the implementation manner of step 403.
For example, if the certificate generation module 603 receives MAC information of the encrypted public key from the I/O module, the encrypted public key may be obtained according to the MAC function and the MAC information. Then, the certificate generation module 603 signs (signing) the encrypted public Key according to the signature verification private Key authentication Key (equivalent to the Key-sig described above), so as to obtain a public Key certificate.
The certificate generation module 603 may then send the public key certificate to the I/O module 601 so that the public key certificate and the encrypted public key are sent to the electronic device through the I/O module 601.
The I/O module 601 is further configured to send an encrypted public key and a public key certificate to the electronic device; i.e. step 404 is performed as described above.
The electronic device may then perform steps 405-410 as described above.
The I/O module 601 is further configured to receive encrypted data from the electronic device to decrypt the encrypted data; the encrypted data is obtained by the electronic device encrypting or decrypting the data according to the encryption public key.
In some embodiments, the I/O module 601 is specifically configured to: and decrypting the encrypted data according to the decryption private key.
The specific process of the I/O module 601 for decrypting the encrypted data can be referred to the above step 411.
In some embodiments, when steps 409 to 411 may be replaced with steps 409a to 412a, the process of the I/O module 601 for receiving the encrypted data from the electronic device may include: receiving an encryption key and encrypted data from the electronic equipment, wherein the encryption key is obtained by encrypting a session key generated by the electronic equipment according to an encryption public key by the electronic equipment; the encrypted data is obtained by encrypting data to be sent by the electronic equipment according to the session key; decrypting the encrypted key according to the decryption private key to obtain a session key; the encrypted data is decrypted based on the session key. The specific implementation can be seen in the description of the above steps 409a to 412 a.
The I/O module 601 may then decrypt the encrypted data received from the electronic device based on the session key. At the same time, the electronic device also encrypts data using the session key.
Therefore, the TEE in the application can generate the encryption public key and the decryption private key for encrypting data, a third party is not required to generate the secret key, the electronic equipment verifies the encryption public key, when the verification is passed, the electronic equipment can encrypt the data by using the encryption public key, and the TEE can decrypt the encrypted data by using the decryption private key. Because the encryption public key for data encryption is generated by the TEE and sent to the electronic equipment, the secret key distribution of a third party does not exist, the safety of information such as private data of a user and the like when the information is injected into the TEE can be ensured, a safe I/O channel between the user and the TEE is realized, and the input safety is ensured.
It should be noted that, when the encrypted data input to the TEE by the user is the encrypted data of the algorithm model, and the TEE decrypts the encrypted data to obtain the algorithm model, the algorithm model may be hardened into a Field-Programmable Gate Array (FPGA) to run. For example, the algorithmic model is an Artificial Intelligence (AI) reasoning model.
Thus, when the algorithm model is executed in the TEE, the algorithm model may be executed by the FPGA in the TEE.
The present application further provides a communication device 80, as shown in fig. 7. The communication device 80 may support TEE, the communication device 80 including a transceiver, a processor, a memory, and a bus. The transceiver, processor and memory are all connected to a bus. The TEE may occupy a portion of the hardware and software resources of the communications device 80 for processing data.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with a processor. A processor may also be a combination of computing functions, e.g., a combination of one or more microprocessors, a Digital Signal Processing (DSP) and a microprocessor, or the like. The storage module may be a memory. The communication module may specifically be a radio frequency circuit, a bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
In one embodiment, the I/O module 601 may be a transceiver; the key generation module 602 and the certificate generation module 603 may be processors, and the communication device 80 in which the TEE according to the present embodiment is located may be a server having a structure shown in fig. 7.
In an embodiment of the present application, a transceiver is configured to receive a key request from an electronic device;
a processor for generating an encrypted public key; generating a public key certificate according to the encrypted public key; the public key certificate is used for verifying the encrypted public key by the electronic equipment; see the description of step 403 for details.
The transceiver is also used for sending the encrypted public key and the public key certificate to the electronic equipment; see the description of step 404 for details;
a transceiver further configured to receive encrypted data from the electronic device to decrypt the encrypted data; the encrypted data is obtained by encrypting the data by the electronic equipment according to the encryption public key. See the description of step 411 for details.
In some embodiments, the processor is specifically configured to: generating an encrypted public key, a decrypted private key and a public key certificate; the specific implementation can be seen in the description of 403.
The processor is further configured to: and decrypting the encrypted data according to the decryption private key. See the description of step 411 for details.
In some embodiments, the transceiver is specifically configured to:
receiving an encryption key and encryption data from the electronic equipment, wherein the encryption key is obtained by encrypting a session key generated by the electronic equipment according to an encryption public key by the electronic equipment; the encrypted data is obtained by encrypting the data to be sent by the electronic equipment according to the session key; the processor is specifically configured to: decrypting the encrypted key according to the decryption private key to obtain a session key; the encrypted data is decrypted based on the session key. See the description of steps 411a, 412 a.
In some embodiments, the processor is specifically configured to sign the encrypted public key according to a signature verification private key of the TEE, and generate a public key certificate. See the description of step 403 for details.
Embodiments of the present application further provide an electronic device, which includes one or more processors and one or more memories. The one or more memories are coupled to the one or more processors for storing computer program code comprising computer instructions which, when executed by the one or more processors, cause the electronic device to perform the associated method steps described above to implement the secure communication method of the above embodiment.
Embodiments of the present application further provide a computer storage medium, where computer instructions are stored, and when the computer instructions are executed on an electronic device, the electronic device is caused to execute the above related method steps to implement the secure communication method in the above embodiment.
Embodiments of the present application further provide a computer program product, which when run on a computer, causes the computer to execute the relevant steps described above, so as to implement the secure communication method performed by the electronic device in the foregoing embodiments.
In addition, an apparatus, which may be specifically a chip, a component or a module, may include a processor and a memory connected to each other; the memory is used for storing computer execution instructions, and when the apparatus runs, the processor can execute the computer execution instructions stored by the memory, so that the chip executes the secure communication method executed by the electronic device in the above method embodiments.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Another embodiment of the present application provides a system, which may include the server where the TEE is located, an electronic device, and an authentication server, and may be configured to implement the secure communication method.
Through the description of the foregoing embodiments, those skilled in the art will understand that, for convenience and simplicity of description, only the division of the functional modules is used for illustration, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules, so as to complete all or part of the functions described above.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, or portions of the technical solutions that substantially contribute to the prior art, or all or portions of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (20)

1. A communication system, characterized in that the communication system comprises a trusted execution environment, TEE, an electronic device and an authentication server, wherein:
the TEE is used for generating an encrypted public key and a public key certificate when receiving a key request from the electronic equipment, and sending the encrypted public key and the public key certificate to the electronic equipment;
the electronic equipment is used for encrypting data to be sent according to the encryption public key and sending the encrypted data to the TEE when the public key certificate passes the verification according to the signature verification public key acquired from the authentication server;
the TEE is further used for decrypting the encrypted data.
2. The communication system of claim 1,
the TEE is specifically configured to: generating the encrypted public key, the decrypted private key and the public key certificate upon receiving the key request;
the TEE is specifically used for: and decrypting the encrypted data according to the decryption private key.
3. The communication system of claim 1,
the electronic device is specifically configured to: when the public key certificate is confirmed to pass verification, a session key is generated, and the session key is encrypted according to the encrypted public key to obtain an encrypted key; encrypting the data to be sent according to the session key to obtain the encrypted data;
sending the encrypted data and the encryption key to the TEE;
the TEE is specifically configured to: decrypting the encryption key according to the decryption private key to obtain the session key; and decrypting the encrypted data according to the session key.
4. The communication system according to any one of claims 1 to 3, wherein the authentication server is configured to send the signing public key and the signing certificate corresponding to the TEE to the electronic device;
the electronic device is further configured to: and verifying the signature verification public key according to the signature verification certificate, and determining that the signature verification public key is legal when the verification is passed.
5. A method for secure processing of data, the method comprising:
when a Trusted Execution Environment (TEE) receives a key request from electronic equipment, the TEE generates an encryption public key and a public key certificate and sends the encryption public key and the public key certificate to the electronic equipment;
when the electronic equipment passes the verification of the public key certificate according to the signature verification public key acquired from the authentication server, encrypting data to be sent according to the encryption public key, and sending the encrypted data to the TEE;
the TEE decrypts the encrypted data.
6. The method of claim 5,
the TEE generating an encrypted public key and a public key certificate comprises: the TEE generates the encrypted public key, a decrypted private key and the public key certificate;
the TEE decrypting the encrypted data comprises: and the TEE decrypts the encrypted data according to the decryption key.
7. The method of claim 5, wherein encrypting the data to be sent according to the encryption public key and sending the encrypted data to the TEE comprises:
generating a session key, and encrypting the session key according to the encryption public key to obtain an encryption key; encrypting the data to be sent according to the session key to obtain the encrypted data; sending the encrypted data and the encryption key to the TEE;
the TEE decrypting the encrypted data comprises: the TEE decrypts the encryption key according to the decryption private key to obtain the session key; and decrypting the encrypted data according to the session key.
8. The method according to any one of claims 5-7, wherein before the electronic device verifies the public key certificate according to the signing public key obtained from the authentication server, the method further comprises:
the authentication server sends the signature verification public key and the signature verification certificate corresponding to the TEE to the electronic equipment;
and the electronic equipment verifies the signature verification public key according to the signature verification certificate, and when the verification is passed, the validity of the signature verification public key is determined.
9. A Trusted Execution Environment (TEE), the TEE comprising:
the input/output I/O module is used for receiving a key request from the electronic equipment and sending the key request to the key generation module;
the key generation module is used for generating an encrypted public key and sending the encrypted public key to the I/O module; the I/O module is also used for sending the encrypted public key to a certificate generating module;
the certificate generating module is used for generating a public key certificate according to the encrypted public key; the public key certificate is used for the electronic equipment to verify the encrypted public key; sending the public key certificate to the I/O module;
the I/O module is further configured to send the encrypted public key and the public key certificate to the electronic device;
the I/O module is further used for receiving encrypted data from the electronic equipment so as to decrypt the encrypted data; and the encrypted data is obtained by encrypting the data to be sent by the electronic equipment according to the encryption public key.
10. The TEE of claim 9,
the key generation module is specifically configured to: generating the encrypted public key, the decrypted private key and the public key certificate;
the I/O module is specifically configured to: and decrypting the encrypted data according to the decryption private key.
11. The TEE of claim 9, wherein the I/O module is specifically configured to:
receiving an encryption key and the encrypted data from the electronic equipment, wherein the encryption key is obtained by encrypting a session key generated by the electronic equipment according to the encryption public key by the electronic equipment; the encrypted data is obtained by encrypting data to be sent by the electronic equipment according to the session key;
decrypting the encryption key according to the decryption private key to obtain the session key; and decrypting the encrypted data according to the session key.
12. The TEE of any one of claims 9-11, wherein the certificate generation module is specifically configured to: and signing the encrypted public key according to the signature verification private key of the TEE to generate the public key certificate.
13. A method for secure processing of data, the method comprising:
generating an encrypted public key upon receiving a key request from an electronic device; generating a public key certificate according to the encrypted public key; the public key certificate is used for the electronic equipment to verify the encrypted public key;
sending the encrypted public key and the public key certificate to the electronic device;
receiving encrypted data from the electronic device to decrypt the encrypted data; and the encrypted data is obtained by encrypting the data to be sent by the electronic equipment according to the encryption public key.
14. The method of claim 13,
the generating of the encrypted public key comprises: generating the encrypted public key, the decrypted private key and the public key certificate;
the decrypting the encrypted data comprises: and decrypting the encrypted data according to the decryption private key.
15. The method of claim 13, wherein receiving encrypted data from the electronic device to decrypt the encrypted data comprises:
receiving an encryption key and the encrypted data from the electronic equipment, wherein the encryption key is obtained by encrypting a session key generated by the electronic equipment according to the encryption public key by the electronic equipment; the encrypted data is obtained by encrypting data to be sent by the electronic equipment according to the session key;
decrypting the encryption key according to the decryption private key to obtain the session key; and decrypting the encrypted data according to the session key.
16. The method according to any one of claims 13-15, wherein the generating a public key certificate from the encrypted public key comprises:
and signing the encrypted public key according to the signature verification private key of the TEE to generate the public key certificate.
17. A communications apparatus, wherein the communications device comprises a transceiver and a processor;
the transceiver is used for receiving a key request from the electronic equipment;
the processor is used for generating an encrypted public key; generating a public key certificate according to the encrypted public key; the public key certificate is used for the electronic equipment to verify the encrypted public key;
the transceiver is further configured to send the encrypted public key and the public key certificate to the electronic device;
the transceiver is further used for receiving encrypted data from the electronic equipment so as to decrypt the encrypted data; and the encrypted data is obtained by encrypting the data to be sent by the electronic equipment according to the encrypted public key.
18. The communications apparatus of claim 17, wherein the processor is specifically configured to: generating an encrypted public key, a decrypted private key and the public key certificate;
the processor is further configured to: and decrypting the encrypted data according to the decryption private key.
19. The communications apparatus of claim 17, wherein the transceiver is specifically configured to:
receiving an encryption key and the encrypted data from the electronic equipment, wherein the encryption key is obtained by encrypting a session key generated by the electronic equipment according to the encryption public key by the electronic equipment; the encrypted data is obtained by encrypting data to be sent by the electronic equipment according to the session key;
the processor is specifically configured to: decrypting the encryption key according to the decryption private key to obtain the session key; and decrypting the encrypted data according to the session key.
20. The communications apparatus as claimed in any of claims 17-19, wherein the processor is specifically configured to sign the encrypted public key according to a signature verification private key of the TEE, to generate the public key certificate.
CN202110529515.0A 2021-05-14 2021-05-14 Data security processing method and device Pending CN115348023A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110529515.0A CN115348023A (en) 2021-05-14 2021-05-14 Data security processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110529515.0A CN115348023A (en) 2021-05-14 2021-05-14 Data security processing method and device

Publications (1)

Publication Number Publication Date
CN115348023A true CN115348023A (en) 2022-11-15

Family

ID=83946937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110529515.0A Pending CN115348023A (en) 2021-05-14 2021-05-14 Data security processing method and device

Country Status (1)

Country Link
CN (1) CN115348023A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116244750A (en) * 2023-03-20 2023-06-09 云海链控股股份有限公司 Secret-related information maintenance method, device, equipment and storage medium
CN117176362A (en) * 2023-11-03 2023-12-05 荣耀终端有限公司 Authentication method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116244750A (en) * 2023-03-20 2023-06-09 云海链控股股份有限公司 Secret-related information maintenance method, device, equipment and storage medium
CN117176362A (en) * 2023-11-03 2023-12-05 荣耀终端有限公司 Authentication method and device
CN117176362B (en) * 2023-11-03 2024-04-02 荣耀终端有限公司 Authentication method and device

Similar Documents

Publication Publication Date Title
CN110855671B (en) Trusted computing method and system
CN111448779B (en) System, device and method for hybrid secret sharing
US11349675B2 (en) Tamper-resistant and scalable mutual authentication for machine-to-machine devices
CN105471833A (en) Safe communication method and device
CN105553951A (en) Data transmission method and data transmission device
CN104094267A (en) Method, device, and system for securely sharing media content from a source device
JP2020530726A (en) NFC tag authentication to remote servers with applications that protect supply chain asset management
US20130174282A1 (en) Digital right management method, apparatus, and system
CN114157415A (en) Data processing method, computing node, system, computer device and storage medium
CN111970114B (en) File encryption method, system, server and storage medium
US20130173912A1 (en) Digital right management method, apparatus, and system
WO2023143037A1 (en) Key management and service processing
EP4258593A1 (en) Ota update method and apparatus
CN111614621A (en) Internet of things communication method and system
CN115348023A (en) Data security processing method and device
CN113726733B (en) Encryption intelligent contract privacy protection method based on trusted execution environment
CN112822021B (en) Key management method and related device
Luring et al. Analysis of security features in DLMS/COSEM: Vulnerabilities and countermeasures
CN112448810B (en) Authentication method and device
US11757856B2 (en) Cryptographic communication system, cryptographic communication method, and cryptographic communication apparatus
US11570008B2 (en) Pseudonym credential configuration method and apparatus
CN114124440A (en) Secure transmission method, device, computer equipment and storage medium
CN106992865A (en) Data signature method and system, data sign test method and device
CN112437436A (en) Identity authentication method and device
CN114258013A (en) Data encryption method, device and storage medium

Legal Events

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