Lightweight DDS secure communication system and method based on OP-TEE secure storage
By adopting OP-TEE secure storage technology in the DDS secure communication system, key derivation and encryption and decryption operations are completed, and the problems of large resource occupation, complex configuration and key leakage risks in the existing technology are solved, and efficient and secure lightweight DDS secure communication is achieved.
Patent Information
- Application Number
- CN202411534946.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing DDS secure communication system is based on the PKI system, with large resource occupancy and complex configuration, which affects performance. At the same time, lightweight DDS security only uses encryption and decryption services, and the session key cannot be generated through the key exchange algorithm, which poses a risk of key leakage.
A lightweight DDS secure communication system based on OP-TEE secure storage is adopted. Key derivation and encryption and decryption operations are completed through OP-TEE. The preset key is securely stored in TEE, and the session key is generated in TEE based on the preset key and guid calculation to ensure that the key does not flow out of the TEE environment.
It effectively avoids key leakage problems, simplifies configuration and usage processes, improves ease of use and security, and reduces system resource consumption.
Smart Images

Figure CN119051861B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data distribution service, and in particular to a lightweight DDS secure communication system and method based on OP-TEE secure storage. Background Art
[0002] DDS (Data Distribution Service) is a communication middleware protocol released by OMG (Object Management Group). DDS adopts a data-centric publish / subscribe architecture system to provide a high-performance, highly reliable, scalable, and loosely coupled solution for data transmission and reception in distributed real-time systems. However, the scalability and loose coupling characteristics of DDS make DDS face threats such as unauthorized publishing / subscription and data information leakage and tampering.
[0003] The DDS-SECURITY (DDS security authentication) standard specification proposed by OMG is based on the PKI system and implements authentication service plug-ins, access control service plug-ins, and encryption service plug-ins. In the authentication service, the publisher and the subscriber use digital certificates to verify each other's identities and generate session keys based on the DHE / ECDHE key exchange algorithm. The access control service uses digital signature authentication technology to authenticate the publishing / subscribing authority, thereby achieving access control on domains, topics, etc. and restricting illegal publishing / subscribing. The encryption service ensures the encryption and integrity of data based on the AES-GCM algorithm. However, DDS-SECURITY based on identity authentication, access control, and key exchange occupies a large number of resources and is complex to configure. It is inconvenient to use and also affects the performance of the DDS service. In order to solve this problem, a lightweight DDS security function is needed to control resource consumption while ensuring the minimum security level.
[0004] Lightweight DDS security only uses encryption and decryption services. Session keys cannot be generated through the key exchange algorithm and need to be set in advance. Therefore, the keys of lightweight DDS security need to be stored more securely to avoid the risk of key leakage. Therefore, a secure storage technology is needed to protect the keys. The secure storage function of TEE (Trusted Execution Environment) can provide a secure storage environment, which will encrypt the data that needs to be saved. The TA (Trusted Application) in TEE runs in an isolated environment, and the preset key storage, key derivation, and encryption and decryption processes can all be completed in TEE. The Linux kernel cannot directly access the data in TEE. Summary of the invention
[0005] In order to solve the deficiencies in the prior art, the object of the present invention is to provide a lightweight DDS secure communication system and method based on OP-TEE secure storage.
[0006] To achieve the purpose of the present invention, the technical solution adopted by the present invention is:
[0007] A lightweight DDS secure communication system based on OP-TEE secure storage includes a lightweight DDS secure communication participant and OP-TEE. When the lightweight DDS secure communication participant performs encryption and decryption during communication, the preset key ID, GUID and data to be encrypted and decrypted are forwarded to OP-TEE, and OP-TEE completes key derivation and encryption and decryption operations, and returns the encrypted and decrypted data to the lightweight DDS secure communication participant.
[0008] Furthermore, the preset key is securely stored in the TEE, and both communicating parties use the same preset key.
[0009] Furthermore, the lightweight DDS secure communication participant forwards the preset key id, its own guid, and plaintext data to TEE; TEE queries the preset key according to the preset key id, and calculates the session key according to the preset key and its own guid; TEE encrypts the plaintext data using the session key, and forwards the encrypted ciphertext to the lightweight DDS secure communication participant; after the lightweight DDS secure communication participant obtains the encrypted ciphertext data, it assembles the RTPS message and sends it to the other lightweight DDS secure communication participant;
[0010] After receiving the RTPS message, the other lightweight DDS secure communication participant forwards the preset key id, the other party's guid, and the ciphertext data to TEE; TEE queries the preset key based on the preset key id, and calculates the session key based on the preset key and the other party's guid; TEE uses the session key to decrypt the ciphertext data and forwards the decrypted plaintext to the lightweight DDS secure communication participant.
[0011] Furthermore, data(p) messages communicated between lightweight DDS secure communication participants are not encrypted.
[0012] Furthermore, the lightweight DDS secure communication participants encrypt the entire RTPS except the RTPS Header.
[0013] Furthermore, the RTPS sub-message is encrypted to obtain the security body SEC_BODY, and SRTPS_PREFIX and INFO_SRC sub-messages are added before the security body, and SRTPS_POSTFIX sub-message is added after the security body; the security body contains the encrypted RTPS sub-message.
[0014] Furthermore, data exchange between lightweight DDS secure communication participants and OP-TEE is carried out through the client application CA running on Linux and the trusted application TA running on OP-TEE. CA uses the TEE ClientAPI interface to communicate with TA and obtain security services from it.
[0015] Furthermore, CA and TA communicate through SMC. When CA initiates a request to TA, it enters the privileged mode of the kernel through a system call. In privileged mode, CA calls TEE driver-related APIs, and the API triggers an SMC instruction; the SMC instruction switches the CPU to monitor mode, backs up the non-secure area context, and then enters the privileged mode of the secure area; in the secure area, the corresponding TA is found according to the parameters carried by the SMC instruction and the corresponding security service is executed. After the execution is completed, the result is returned to CA in REE through shared memory or other means.
[0016] A lightweight DDS secure communication method based on OP-TEE secure storage, comprising the steps of:
[0017] (1) Lightweight DDS secure communication participant A forwards the preset key ID, its own GUID, and plaintext data to TEE;
[0018] (2) TEE queries the preset key based on the preset key ID, and calculates the session key based on the preset key and guid;
[0019] (3) TEE uses the session key to encrypt the plaintext data and forwards the encrypted ciphertext to lightweight DDS secure communication participant A;
[0020] (4) After lightweight DDS secure communication participant A obtains the encrypted ciphertext data, it assembles the RTPS message and sends it to lightweight DDS secure communication participant B;
[0021] (5) After receiving the RTPS message, lightweight DDS secure communication participant B forwards the preset key id, the other party's guid, and the ciphertext data to TEE;
[0022] (6) TEE queries the preset key based on the preset key ID, and calculates the session key based on the preset key and guid;
[0023] (7) TEE uses the session key to decrypt the ciphertext data and forwards the decrypted plaintext to lightweight DDS secure communication participant B;
[0024] (8) Lightweight DDS secure communication participant B receives the plaintext data.
[0025] The beneficial effect of the present invention is that, compared with the prior art, the present invention solves the problem of secure storage of preset keys based on the secure storage characteristics of OP-TEE, uses keys in a trusted TEE environment, and based on the access control policy of TEE, after the preset keys are imported into TEE, they will be encrypted and stored. The session key is calculated and generated in TEE based on the preset key and GUID, and will never flow out of the TEE environment, effectively avoiding the problem of key leakage. Based on lightweight DDS security, the configuration and use process is simplified, the usability and security are improved, and the resource consumption of the system is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a schematic diagram of OP-TEE's software architecture;
[0027] Figure 2 This is a schematic diagram of the message format for lightweight DDS security encryption and decryption;
[0028] Figure 3 It is a flow chart of the lightweight DDS secure communication method. DETAILED DESCRIPTION
[0029] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of this application.
[0030] The lightweight DDS secure communication system based on OP-TEE secure storage described in the present invention includes a lightweight DDS secure communication participant and OP-TEE. When the lightweight DDS secure communication participant needs encryption and decryption during communication, the preset key ID, GUID and data to be encrypted and decrypted are forwarded to OP-TEE, and OP-TEE completes the key derivation and encryption and decryption operations, and returns the encrypted and decrypted data to the lightweight DDS secure communication participant.
[0031] When encrypting, use the preset key ID and your own GUID for encryption, and when decrypting, use the preset key ID and the other party's GUID for decryption.
[0032] The lightweight DDS secure communication system based on OP-TEE secure storage described in the present invention securely stores the preset key in TEE, and both communicating parties need to use the same preset key.
[0033] The lightweight DDS secure communication participant forwards the preset key id, its own guid, and plaintext data to TEE; TEE queries the preset key based on the preset key id, and calculates the session key based on the preset key and its own guid; TEE uses the session key to encrypt the plaintext data, and forwards the encrypted ciphertext to the lightweight DDS secure communication participant; after the lightweight DDS secure communication participant obtains the encrypted ciphertext data, it assembles the RTPS message and sends it to the other lightweight DDS secure communication participant.
[0034] After receiving the RTPS message, the other lightweight DDS secure communication participant forwards the preset key id, the other party's guid, and the ciphertext data to TEE; TEE queries the preset key based on the preset key id, and calculates the session key based on the preset key and the other party's guid; TEE uses the session key to decrypt the ciphertext data and forwards the decrypted plaintext to the lightweight DDS secure communication participant.
[0035] The data(p) messages communicated between lightweight DDS secure communication participants are not encrypted. Lightweight DDS secure communication participants encrypt the entire RTPS except the RTPS Header.
[0036] like Figure 2 As shown in the figure, the RTPS sub-message (RTPS SubMessage) is encrypted to obtain the security body (SEC_BODY), and SRTPS_PREFIX and INFO_SRC sub-messages are added before and after the security body, and SRTPS_POSTFIX sub-message is added after the security body. The security body contains the encrypted RTPS sub-message; the SRTPS_PREFIX sub-message is mainly used to indicate the encryption type and algorithm, such as AES_256_GMAC, AES_256_GCM, etc.; the INFO_SRC sub-message is mainly used to transmit GUID; SRTPS_POSTFIX is used to carry the message authentication code when the encryption algorithm includes GMAC, so as to verify the integrity of the message.
[0037] The present invention is based on OP-TEE (Open-source Portable Trusted Execution Environment) to ensure the confidentiality of pre-set keys and session keys. The isolated environment provided by OP-TEE can ensure the integrity and confidentiality of code / data, and even replace the dedicated security chip with a software solution to reduce hardware costs. In addition, the storage, key derivation, encryption and decryption of pre-set keys are completed in TEE to achieve lightweight secure communication; identity authentication, access control, and key exchange processes are deleted, the use configuration and environment deployment are simplified, and resource consumption is reduced, while security can be guaranteed to the minimum extent to achieve secure communication of DDS.
[0038] like Figure 1 As shown in the figure, the data exchange between the lightweight DDS secure communication participants and OP-TEE is carried out through the client application (CA) running on Linux and the trusted application (TA) running on OP-TEE. The code / data running on the secure world (Secure World, such as OP-TEE) cannot be directly accessed from the normal world (Normal World, such as Linux / Android). CA uses the TEE Client API interface to communicate with TA and obtain security services from it.
[0039] TEE Client API is a set of interfaces provided by TEE for client applications to interact with TEE. Client applications can call functions in TEE through TEE Client API, such as secure storage, encryption, and decryption.
[0040] TEE Internal Core API is a set of interfaces provided by TEE, including cryptographic algorithms, secure storage and other functions.
[0041] TEE Supplicant is a daemon process that runs at the Linux application layer. Its function is to process RPC requests. Its main function is to help TEE access resources on the Linux side.
[0042] CA and TA communicate through SMC (Secure Monitor Call). When CA needs to initiate a request to TA, it will enter the privileged mode of the kernel through a system call. In privileged mode, CA will call TEE driver-related APIs, which will trigger an SMC instruction. The SMC instruction will switch the CPU to monitor mode, back up the non-secure zone context, and then enter the privileged mode of the secure zone. In the secure zone, according to the parameters carried by the SMC instruction (such as TA's UUID, command ID, etc.), the corresponding TA is found and the corresponding security service is executed. After the execution is completed, the result is returned to the CA in the REE through shared memory or other means. At this time, the CPU will be restored to the privileged mode of the non-secure zone, and the REE will restore the previously backed up context and pass the result to the CA.
[0043] like Figure 3 As shown, the lightweight DDS secure communication method based on OP-TEE secure storage of the present invention includes the following steps:
[0044] (1) Lightweight DDS secure communication participant A forwards the preset key ID, its own GUID, and plaintext data to TEE;
[0045] (2) TEE queries the preset key based on the preset key ID, and calculates the session key based on the preset key and guid;
[0046] (3) TEE uses the session key to encrypt the plaintext data and forwards the encrypted ciphertext to lightweight DDS secure communication participant A;
[0047] (4) After lightweight DDS secure communication participant A obtains the encrypted ciphertext data, it assembles the RTPS message and sends it to lightweight DDS secure communication participant B;
[0048] (5) After receiving the RTPS message, lightweight DDS secure communication participant B forwards the preset key id, the other party's guid, and the ciphertext data to TEE;
[0049] (6) TEE queries the preset key based on the preset key ID, and calculates the session key based on the preset key and guid;
[0050] (7) TEE uses the session key to decrypt the ciphertext data and forwards the decrypted plaintext to lightweight DDS secure communication participant B;
[0051] (8) Lightweight DDS secure communication participant B performs subsequent operations after receiving the plaintext data.
[0052] The beneficial effect of the present invention is that, compared with the prior art, the present invention solves the problem of secure storage of preset keys based on the secure storage characteristics of OP-TEE, uses keys in a trusted TEE environment, and based on the access control policy of TEE, after the preset keys are imported into TEE, they will be encrypted and stored. The session key is calculated and generated in TEE based on the preset key and GUID, and will never flow out of the TEE environment, effectively avoiding the problem of key leakage. Based on lightweight DDS security, the configuration and use process is simplified, the usability and security are improved, and the resource consumption of the system is reduced.
[0053] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
Claims
1. A lightweight DDS secure communication system based on OP-TEE secure storage, characterized in that: It includes lightweight DDS secure communication participants and OP-TEE. When lightweight DDS secure communication participants perform encryption and decryption during communication, they forward the preset key ID, GUID, and data to be encrypted and decrypted to OP-TEE. OP-TEE completes the key derivation and encryption and decryption operations, and returns the encrypted and decrypted data to the lightweight DDS secure communication participants. The pre-set key is securely stored in TEE, and both communicating parties use the same pre-set key; The lightweight DDS secure communication participant forwards the preset key ID, its own GUID, and plaintext data to TEE; TEE queries the preset key based on the preset key ID, and calculates the session key based on the preset key and its own GUID; TEE uses the session key to encrypt the plaintext data and forwards the encrypted ciphertext to the lightweight DDS secure communication participant; after the lightweight DDS secure communication participant obtains the encrypted ciphertext data, it assembles the RTPS message and sends it to the other lightweight DDS secure communication participant; After receiving the RTPS message, the other lightweight DDS secure communication participant forwards the preset key id, the other party's guid, and the ciphertext data to TEE; TEE queries the preset key based on the preset key id, and calculates the session key based on the preset key and the other party's guid; TEE uses the session key to decrypt the ciphertext data and forwards the decrypted plaintext to the lightweight DDS secure communication participant.
2. According to claim 1, the lightweight DDS secure communication system based on OP-TEE secure storage is characterized in that: The data(p) messages communicated between lightweight DDS secure communication participants are not encrypted.
3. The lightweight DDS secure communication system based on OP-TEE secure storage according to claim 1 is characterized in that: Lightweight DDS secure communication participants encrypt the entire RTPS except the RTPS Header.
4. According to claim 3, the lightweight DDS secure communication system based on OP-TEE secure storage is characterized in that: After the RTPS sub-message is encrypted, the security body SEC_BODY is obtained, and SRTPS_PREFIX and INFO_SRC sub-messages are added before the security body, and SRTPS_POSTFIX sub-message is added after the security body; the security body contains the encrypted RTPS sub-message.
5. The lightweight DDS secure communication system based on OP-TEE secure storage according to claim 1 is characterized in that: The data exchange between lightweight DDS secure communication participants and OP-TEE is carried out through the client application CA running on Linux and the trusted application TA running on OP-TEE. CA uses the TEE Client API interface to communicate with TA and obtain security services from it.
6. The lightweight DDS secure communication system based on OP-TEE secure storage according to claim 5 is characterized in that: CA and TA communicate through SMC. When CA initiates a request to TA, it enters the privileged mode of the kernel through a system call. In privileged mode, CA calls TEE driver-related APIs, which trigger an SMC instruction. The SMC instruction switches the CPU to monitor mode, backs up the non-secure zone context, and then enters the privileged mode of the secure zone. In the security zone, the corresponding TA is found according to the parameters carried by the SMC instruction and the corresponding security service is executed. After the execution is completed, the result is returned to the CA in the REE through shared memory or other means.
7. A lightweight DDS secure communication method based on OP-TEE secure storage, based on the lightweight DDS secure communication system based on OP-TEE secure storage according to any one of claims 1 to 6, characterized in that: Includes steps: (1) Lightweight DDS secure communication participant A forwards the preset key ID, its own GUID, and plaintext data to TEE; (2) TEE queries the preset key based on the preset key ID, and calculates the session key based on the preset key and guid; (3) TEE uses the session key to encrypt the plaintext data and forwards the encrypted ciphertext to lightweight DDS secure communication participant A; (4) After lightweight DDS secure communication participant A obtains the encrypted ciphertext data, it assembles the RTPS message and sends it to lightweight DDS secure communication participant B; (5) After receiving the RTPS message, lightweight DDS secure communication participant B forwards the preset key id, the other party's guid, and the ciphertext data to TEE; (6) TEE queries the preset key based on the preset key ID, and calculates the session key based on the preset key and guid; (7) TEE uses the session key to decrypt the ciphertext data and forwards the decrypted plaintext to lightweight DDS secure communication participant B; (8) Lightweight DDS secure communication participant B receives the plaintext data.
Citation Information
Patent Citations
Key-free DDS security authentication and communication method based on OP-TEE
CN117254916A