Key security collaborative management and use method based on distributed hardware of honghong
By segmenting and securely storing key fragments in the HarmonyOS distributed hardware environment and generating the final result in collaborative computing, the single point of failure and exposure risk of key management in distributed scenarios are solved, and the secure, convenient use and high availability of keys are achieved.
Patent Information
- Application Number
- CN202610143184.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-02
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies for key management in distributed scenarios suffer from single point of failure risks and key migration exposure risks. Furthermore, they rely on remote servers, increasing network dependence and attack surface, and fail to effectively solve the problem of secure, convenient, and highly available collaborative use of keys in trusted device clusters.
Based on HarmonyOS distributed hardware, a collaborative security group is formed through unified identity authentication and device mutual trust capabilities. The original key is divided into multiple key fragments using a secret sharing algorithm and securely stored in the hardware-level security environment of different trusted devices. During the collaborative computing process, the final result is generated through partial cryptographic operations to ensure that the original key is not reconstructed.
It achieves "accessible but not visible" keys, improving the security and availability of keys throughout their lifecycle, avoiding single points of failure and key migration exposure risks, reducing system complexity and attack surface, and supporting dynamic member management and business continuity.
Smart Images

Figure CN122160042A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, specifically to a method for secure collaborative management and use of keys based on HarmonyOS distributed hardware. Background Technology
[0002] With the deep integration of the Internet of Things and the mobile Internet, the ecosystem of distributed operating systems that support seamless collaboration among multiple devices is developing rapidly, enabling cross-device resource integration and task flow, and giving rise to a large number of innovative application scenarios.
[0003] However, the rise of distributed scenarios has presented new challenges to the management of core security assets such as keys. Current mainstream solutions rely on the hardware security environment of a single device (such as a security chip or trusted execution environment) for the complete storage and computation of keys. This centralized model has obvious limitations in distributed environments: keys are strongly bound to specific devices, posing a single point of failure risk; loss or damage to the device will directly jeopardize key security and business continuity. When using keys across devices, existing solutions often require key migration or transmission, increasing the risk of exposure. Solutions relying on remote servers introduce network dependencies and additional attack surfaces. Although underlying distributed collaboration technologies are constantly advancing, existing technologies have not effectively resolved the fundamental contradiction of how to achieve secure, convenient, and highly available collaborative use of keys in a trusted device cluster while ensuring that keys are never completely reconstructed or exposed. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method for secure collaborative management and use of keys based on HarmonyOS distributed hardware, in order to solve or improve the technical problems existing in the prior art.
[0005] To address the aforementioned technical problems, this invention provides a method for secure collaborative management and use of keys based on HarmonyOS distributed hardware, comprising the following steps: S1. Responding to user commands, based on the unified identity authentication and distributed device mutual trust capabilities of the HarmonyOS operating system, multiple authenticated trusted devices with hardware-level security environments are grouped into a collaborative security group; S2. Within the collaborative security group, an original key is generated, and the original key is divided into multiple key fragments using a secret sharing algorithm. The secret sharing algorithm is configured such that at least one preset threshold number (K) of key fragments is required to recover the original key. S3. Each of the key fragments is securely stored in the hardware-level security environment of different trusted devices within the collaborative security group through a secure communication channel provided by HarmonyOS distributed soft bus, so that each trusted device only persistently stores one key fragment that cannot be individually restored from the original key; S4. In response to a cryptographic operation request for the original key, multiple trusted devices within the collaborative security group that meet at least the preset threshold number (K) perform collaborative computation: each participating device performs partial cryptographic operations on the computation data based on locally stored key fragments in its own hardware-level security environment, generating partial computation results; S5. Securely aggregate the partial computation results generated by each participating device and synthesize them into the final complete cryptographic computation result in a hardware-level secure environment; Wherein, after the original key is split, its complete form is not reconstructed in any storage, communication and collaborative computing process of the collaborative security group.
[0006] Compared with existing technologies, the beneficial effects of this invention are as follows: By fragmenting and distributing the original key in a hardware-level secure environment across multiple trusted devices, and designing a collaborative cryptographic operation process that does not require reconstructing the complete key, this invention resolves the contradiction between the "single point of failure risk" and the "key migration exposure risk" faced by traditional centralized key management models in distributed scenarios. Specifically, this invention achieves "usable but invisible" keys, meaning that the original key is never completely reconstructed or presented in any storage, communication, or computation stage, thereby greatly improving the security of the key lifecycle and effectively resisting physical attacks or software cracking against a single device. Through the (K, N) threshold mechanism, the system can still maintain key availability when some devices are lost, damaged, or offline, eliminating single points of failure and significantly improving the availability and business continuity of key management. Simultaneously, the solution supports dynamic member management and key recovery, enabling flexible and secure responses to dynamic changes in device groups. Furthermore, this method deeply integrates with the distributed device trust and secure communication capabilities of the HarmonyOS operating system, achieving efficient and native collaboration, avoiding dependence on external centralized servers, and reducing system complexity and additional attack surfaces. Attached Figure Description
[0007] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0008] Figure 1 This is a diagram of the overall system architecture of the present invention; Figure 2 This is the overall flowchart of key security collaborative management and use in this invention; Figure 3 This is a flowchart illustrating the key segmentation and secure storage process of the present invention. Detailed Implementation
[0009] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The embodiments of the present invention are given for illustrative and descriptive purposes, and as those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0010] This invention proposes a method for secure collaborative management and use of keys based on HarmonyOS distributed hardware, comprising the following steps: S1. Responding to user commands, based on the unified identity authentication and distributed device mutual trust capabilities of the HarmonyOS operating system, multiple authenticated trusted devices with hardware-level security environments are grouped into a collaborative security group; S2. Within the collaborative security group, an original key is generated, and the original key is divided into multiple key fragments using a secret sharing algorithm. The secret sharing algorithm is configured such that at least a preset threshold number of key fragments K are required to recover the original key. S3. Each key fragment is securely stored in the hardware-level security environment of different trusted devices within the collaborative security group through a secure communication channel provided by HarmonyOS distributed soft bus, so that each trusted device only persistently stores one key fragment that cannot be individually restored from the original key. S4. In response to the cryptographic operation request for the original key, multiple trusted devices within the collaborative security group that meet at least the preset threshold number K shall perform collaborative computation: each participating device, in its own hardware-level security environment, performs partial cryptographic operations on the computation data based on locally stored key fragments, and generates partial computation results; S5. Securely aggregate the partial computation results generated by each participating device and synthesize them into the final complete cryptographic computation result in a hardware-level secure environment; Since the original key was split, its complete form has not been reconstructed during any storage, communication, and collaborative computing processes within the collaborative security group.
[0011] Specifically, in step S1, in response to a user's instruction on a device, such as selecting "Create Security Group" or "Join Security Group" through the user interface, the system will initiate the group creation process. This process utilizes the unified identity authentication mechanism provided by the HarmonyOS operating system to verify the user's identity and the devices to be added. Simultaneously, a trust chain is established between devices through distributed device trust capabilities. Multiple authenticated devices with hardware-level security environments, such as smartphones, tablets, and smartwatches, can be dynamically discovered and added to the collaborative security group. This group creation process can be completed either manually by the user confirming the addition of each device or automatically through a preset trust policy. After the group is created, the devices within the collaborative security group form a logical security entity, capable of jointly managing and using keys.
[0012] In step S2, after the collaborative security group is established, an initial key needs to be generated. This initial key is generated in any trusted device within the collaborative security group, or by a dedicated key generation service. After generation, the initial key is not stored in its complete form, but is divided into multiple key fragments using a secret-sharing algorithm. This secret-sharing algorithm is designed to have a preset threshold number K, meaning that the initial key can only be recovered when at least K key fragments are collected. For example, a secret-sharing scheme based on polynomial interpolation can be used, where the initial key is treated as a constant term in a polynomial, and fragments are generated by calculating polynomial values at different points. Each fragment contains information about a single point on the polynomial.
[0013] In step S3, after key fragments are generated and segmented, each key fragment is securely stored. Through a secure communication channel provided by the HarmonyOS distributed soft bus, such as an end-to-end encrypted communication link, each key fragment is transmitted to different trusted devices within the collaborative security group. Each trusted device receives and persistently stores only one key fragment, and this fragment is stored within its own hardware-level security environment. This storage method ensures that no single device can recover the original key, thus avoiding the risk of single point of failure and key leakage. After distribution, the device or service used to generate the original key ensures that the complete form of the original key no longer exists in any general storage area.
[0014] In step S4, when the system receives a cryptographic operation request for the original key, such as a signature request or decryption request, the devices within the collaborative security group will initiate a collaborative computation process. This process requires the participation of at least a preset threshold number K trusted devices. Each participating device, within its own hardware-level security environment, utilizes its locally stored key fragments to perform partial cryptographic operations on the input computation data. For example, if the request is for a signature, each device will compute a portion of the intermediate results in the signature process based on its fragments. These partial computation results are designed so that they cannot individually reveal the original key or complete the full cryptographic operation.
[0015] In step S5, after each participating device completes partial cryptographic operations and generates partial results, these partial results are securely aggregated through a secure communication channel. The aggregated partial results are then synthesized within a designated hardware-level security environment. This synthesis process combines these partial results to generate the final, complete cryptographic result. This synthesis algorithm ensures that the final result is equivalent to the result obtained by directly performing cryptographic operations using the complete original key. Importantly, throughout the entire collaborative computation and synthesis process, the complete form of the original key is never reconstructed; it exists only in fragmented form within the hardware-level security environments of each device, thus maintaining the highest level of key security.
[0016] This invention effectively avoids the single point of failure risk of traditional solutions by dividing the original key into multiple key fragments and distributing them in a hardware-level secure environment across multiple trusted devices. When cryptographic operations are required, a collaborative computing mechanism allows each device to perform partial operations and synthesize the final result without reconstructing the complete key, enabling secure and flexible use of the key in a distributed scenario. This avoids the risk of key exposure during inter-device transmission, reduces reliance on centralized services, and improves the availability and security of key management.
[0017] In the above embodiments of the present invention, distributed secure key management is achieved by dividing the original key into multiple key fragments and storing them in a hardware-level secure environment. However, in practical applications, ensuring that the hardware-level secure environment has sufficient resistance to attacks and securely managing the member information of the collaborative security group are crucial to ensuring the security and reliability of the entire key management system.
[0018] In response, this invention further proposes that the hardware-level security environment be the trusted execution environment (TEE) or security chip (SE) of the device; the step of forming a collaborative security group also includes encrypting and storing configuration data containing the identity information of member devices in the hardware-level security environment of each member device.
[0019] Specifically, the hardware-level security environment can be configured as a Trusted Execution Environment (TEE) or a Security Chip (SE) within the device. A Trusted Execution Environment (TEE) is an isolated execution environment that runs in parallel with the main operating system, providing hardware-level security isolation. It protects sensitive data and code from malware and attacks, ensuring a high degree of confidentiality and integrity for applications and data executed within it. For example, a TEE can be implemented based on ARM TrustZone technology, with the HarmonyOS operating system utilizing the SecureWorld provided by TrustZone to run sensitive security services and store key fragments. A Security Chip (SE) is an independent, tamper-proof hardware module, typically integrated into the device, used for securely storing sensitive information such as keys and certificates, and performing cryptographic operations. An SE has its own independent operating system and storage space, capable of resisting both physical and software attacks, providing a higher level of security than a TEE. Examples include eSE (embedded Secure Element) integrated into smartphones, tablets, and other devices, or the SE within a UICC (Universal Integrated Circuit Card). Explicitly designate TEE or SE as the hardware-level security environment, providing specific, high-security hardware protection mechanisms to ensure the security of key fragment storage and cryptographic operations, and prevent key fragments from being illegally accessed or tampered with.
[0020] Furthermore, the process of establishing a collaborative security group includes encrypting and storing configuration data containing member device identity information within the hardware-level security environment of each member device. This is used to securely manage the member identity information of the collaborative security group, ensuring that only authorized devices can participate and preventing configuration data from being tampered with or leaked. Specifically, after generation, configuration data (e.g., unique identifiers of member devices, public keys, device types, security levels, etc.) is encrypted using a key accessible only to the hardware-level security environment and then stored in a protected storage area of the TEE or SE. This encrypted configuration data is stored in non-volatile memory within the TEE or SE to prevent data loss or external access after a device reboot.
[0021] By explicitly defining the hardware-level security environment as the Trusted Execution Environment (TEE) or Security Chip (SE) of the device, this invention provides a high level of hardware protection for key fragment storage and cryptographic operations. TEE and SE possess strong anti-tampering and anti-theft capabilities, effectively resisting various software and physical attacks, thereby greatly improving the confidentiality and integrity of key fragments and ensuring the security of the collaborative computing process. Simultaneously, by encrypting and storing configuration data containing member device identity information within the hardware-level security environment of each member device, this invention ensures that the member identity information of the collaborative security group is strictly protected, preventing unauthorized devices from joining or maliciously tampering with the configuration data, thus maintaining the overall trust chain and operational reliability of the collaborative security group. This mechanism enables the entire key management system to possess stronger anti-attack capabilities and higher security in a distributed environment, providing a solid security foundation for subsequent key steps such as key fragment storage and collaborative computing.
[0022] In the above embodiments of the present invention, a method is proposed to generate an initial key within a collaborative security group and divide it into multiple key fragments, which are then securely stored in hardware-level security environments on different trusted devices. However, if the highest level of security throughout the entire lifecycle is not ensured during the initial generation and distribution of the initial key, for example, if the initial key exists briefly in an insecure environment after generation or before distribution, or if there is a risk of leakage during distribution, it may provide attackers with a potential attack window, thereby affecting the security of the entire key management system.
[0023] To address this, the present invention further proposes that the step of generating and segmenting the original key be performed in a hardware-level security environment of a master device, generating N key fragments and setting a recovery threshold of K, satisfying K≤N; the secure storage step includes: the master device distributing (N-1) key fragments to other slave devices through the secure communication channel, and then clearing the original key stored in itself.
[0024] Specifically, the generation of the original key and the execution of the secret sharing algorithm are confined to the hardware-level secure environment of the master device, such as a Trusted Execution Environment (TEE) or a Secure Execution Chip (SE). This hardware-level secure environment provides isolated execution space and storage capabilities, effectively resisting software attacks and physical tampering, thereby minimizing the risk of the original key being stolen or tampered with during the generation phase. The master device, as the coordinator or initiator of the collaborative security group, assumes responsibility for the initial key generation and fragmentation; its selection and configuration are crucial. In this process, the original key is divided into N key fragments, and the minimum number of fragments required to recover the original key is set to K. The purpose of setting N and K is to strike a balance between key availability and security. By determining these parameters and performing the fragmentation within the hardware-level secure environment of the master device, the reliability of the parameter settings and execution of the secret sharing process is ensured.
[0025] After generating N key fragments, the master device distributes (N-1) of these fragments to other slave devices within the collaborative security group via a secure communication channel. This secure communication channel, such as the encrypted channel provided by the HarmonyOS distributed soft bus, ensures the confidentiality and integrity of the fragments during transmission, preventing man-in-the-middle attacks or eavesdropping. This distribution method ensures that each slave device receives only one key fragment, and this fragment cannot be used to reconstruct the original key. More importantly, after the master device completes the generation, segmentation, and secure distribution of the (N-1) key fragments to the slave devices, it immediately removes the original key stored within its hardware-level security environment. That is, the complete form of the original key only exists briefly within the master device's hardware-level security environment and is destroyed after the distribution task is completed. This avoids the master device becoming a long-term storage point for the original key, eliminates the risk of a single point of failure, and further enhances the key security of the entire collaborative security group.
[0026] The above technical solution confines the generation and segmentation of the original key to a hardware-level secure environment on the master device, ensuring the security of the original key from the source and effectively resisting potential attacks in the early stages of key generation. Simultaneously, by distributing key fragments to other slave devices via a secure communication channel and immediately deleting its own stored original key, the master device ensures that the complete form of the original key no longer exists in any single device after distribution, thus avoiding the risk of the master device becoming a single point of failure for key leakage. This mechanism significantly improves the initial security of the key, the reliability of distribution, and the overall system's resistance to attacks, making it difficult to compromise the integrity of the original key even if some devices are compromised, laying a solid security foundation for subsequent collaborative cryptographic operations.
[0027] In the above embodiments of the present invention, an original key is generated within a collaborative security group and divided into multiple key fragments using a secret sharing algorithm to ensure that the complete form of the original key is not reconstructed. However, if the selection and implementation of the secret sharing algorithm are not rigorous enough, it may not be able to fully guarantee the security of the key fragments and the unrecoverability of the original key, thereby introducing potential security risks or resulting in low efficiency in key recovery and collaborative computation processes.
[0028] To address this, the present invention further proposes the above-mentioned method of using a secret sharing algorithm to segment the original key into a (K, N) threshold using Shamir's secret sharing. Specifically, in a finite field... A random (K-1) degree polynomial is constructed, where the constant term is the original key S, thereby generating N fragments. The fragment data held by any device is... ,in This is a sharded index. The mathematical expression of the polynomial is: , where S represents the original key to be segmented, and is a constant term in the polynomial; In a finite field The coefficients are randomly selected to ensure the randomness and security of the sharding. It is a large prime number, and defines a finite field for operations; It is the independent variable; different non-zero values are substituted into it. The corresponding fragment value can then be calculated. ; This is the recovery threshold. The formula indicates that obtaining any... A different point The polynomial can then be uniquely determined and reconstructed using Lagrange interpolation. less than K At this point, it is impossible to obtain information about... Any information.
[0029] Shamir's (K, N) threshold for secret sharing is based on a polynomial interpolation cryptographic algorithm that divides a secret (in this case, the original key S) into N fragments. This ensures that the original secret can only be reconstructed when at least K fragments are collected; otherwise, no information about the secret can be obtained. This provides a mathematically rigorous and secure secret-sharing mechanism, guaranteeing distributed storage of key fragments and the unrecoverable nature of the original key.
[0030] Constructing a random (K-1)th degree polynomial over the finite field GF(p) is a key step in Shamir's secret-sharing algorithm. A finite field (Galois Field, GF(p)) is a mathematical set containing a finite number of elements, where addition, subtraction, multiplication, and division (with a non-zero divisor) can be performed, and the result of the operation remains within the set. Performing operations over a finite field prevents secret leakage and ensures the accuracy and security of the computation. By choosing a sufficiently large prime number... As the modulus of a finite field, and in generating the original key. Then, randomly select K-1 coefficients. (These coefficients should also be within the range of GF(p),) and then construct the polynomial. Randomly selecting the coefficients of the polynomial increases the randomness and security of the sharding, making it difficult for attackers to obtain secrets through guessing or brute-force attacks.
[0031] The original key S is used as a constant term in the polynomial, i.e. This is the mathematical foundation of Shamir's secret-sharing algorithm. It ensures that the original key S can be directly obtained after recovering the polynomial through interpolation. During polynomial construction, the original key S to be segmented is directly assigned to the constant term of the polynomial, thus embedding the secret into the polynomial and guaranteeing a direct correlation between the secret and the polynomial.
[0032] Generate N fragments, where any device holds fragment data of... , This is the shard index. A shard is the result of a polynomial calculation at a specific point. N is the number of devices in the collaborative security group, and each device will receive one shard. In the polynomial... After construction is complete, select N distinct non-zero points. (For example, you can simply choose 1, 2, ..., N), and then calculate. , ,..., Each device You will get a shard pair Each fragment itself does not contain any information about the original key, but multiple fragments can be combined to recover the original key. Fragment Index Used to distinguish different pieces and as input for Lagrange interpolation during recovery.
[0033] Lagrange interpolation is a key step in Shamir's secret sharing algorithm for recovering the original key, used to find the key from K distinct points. To construct a unique K-1 degree polynomial. When the original key needs to be recovered, at least K fragments must be collected. The Lagrange interpolation formula can then be used. ,in From 1 to K, j from 1 to K and Through calculation The original key S can then be obtained. This ensures that the original key S can be accurately recovered as long as K or more fragments are collected, but it is not possible with fewer than K fragments.
[0034] By employing Shamir's secret-shared (K, N) threshold scheme, this invention provides a mathematically rigorous and widely accepted security mechanism for the segmentation of the original key. A random polynomial is constructed over the finite field GF(p), with the original key S as a constant term, ensuring that each key is fragmented. Mathematically, there is a precise correlation between the key and the original key S, while ensuring that no single key fragment can reveal any information about the original key. This significantly enhances key security; even if an attacker obtains fewer than K key fragments, they cannot gain any information about the original key S. Simultaneously, it guarantees key availability in the event of partial device failure. As long as K or more devices are online and provide their key fragments, the original key S can be uniquely and accurately recovered using Lagrange interpolation. Its compatibility with the collaborative security group architecture of HarmonyOS distributed hardware ensures that the original key S does not exist in its complete form throughout its lifecycle, but is only stored in fragment form across different devices within a hardware-level security environment. This avoids the risk of single-point key leakage and provides a solid mathematical foundation for subsequent collaborative computing.
[0035] In the above embodiments of the present invention, it is proposed that within a collaborative security group, each trusted device performs partial cryptographic operations on computational data based on locally stored key fragments in its own hardware-level security environment, and generates partial operation results. However, effectively coordinating these partial operations and ensuring that the partial operation results generated by each device are securely aggregated and synthesized into the final complete cryptographic operation result without reconstructing the original key is the key to realizing the secure use of distributed keys.
[0036] In response, this invention further proposes a specific implementation method for the collaborative computing step, which includes: Any member device within the collaborative security group acts as a coordinator, sending a collaborative computing request and the data to be computed to at least (K-1) other member devices through a secure communication channel; Each responding member device, within its own hardware-level security environment, uses locally stored key fragments to perform partial cryptographic operations on the data to be processed, generates partial operation results, and returns them to the coordinator. Within its own hardware-level secure environment, the coordinator utilizes the partial computation results it generates and receives to obtain the final complete cryptographic computation result through a synthesis algorithm; Specifically, the mathematical expression of the synthesis algorithm is as follows: ,in, Indicates participation in collaborative computing A collection of indexes for each device; Indicates the first Each device fragments its key within a local security environment. The partial calculation results derived from the input data; This represents the deterministic composition function corresponding to the underlying secret-sharing scheme and cryptographic algorithm. The design of this composition function guarantees... With the full key The results of directly processing the input data are exactly the same, and this is also true throughout the entire synthesis process. Not refactored.
[0037] Specifically, in the aforementioned collaborative computing process, a coordinator must first be designated. This coordinator can be any member device within the collaborative security group, and its selection is based on various strategies, such as pre-setting, dynamic election (e.g., based on the device's computing power, network stability, or load), or automatic appointment by the device initiating the cryptographic computation request. The coordinator's main role is to act as the central hub of the collaborative computing, responsible for initiating computation requests, collecting partial computation results from participating devices, and ultimately synthesizing the results.
[0038] Once the coordinator is determined, a collaborative computing request is sent to at least (K-1) other member devices within the collaborative security group via a secure communication channel. This secure communication channel, provided by the HarmonyOS distributed soft bus, ensures the confidentiality, integrity, and authentication of the request and the data to be computed during transmission, preventing eavesdropping or tampering. The collaborative computing request contains data to be cryptographically processed, such as the hash value of the message to be signed or a data block to be encrypted. Since the secret sharing algorithm requires a preset threshold of K key fragments to recover the original key, collaborative computing requires at least K devices to participate, including the coordinator itself and the other (K-1) responding devices.
[0039] Upon receiving a collaborative computing request, each responding member device will perform partial cryptographic operations within its respective hardware-level secure environment. This hardware-level secure environment, such as a Trusted Execution Environment (TEE) or a Secure Execution Chip (SE), provides an isolated and protected execution space for key fragmentation and cryptographic operations, effectively resisting malicious attacks at the operating system level. Each device uses only its locally persistently stored key fragments to compute the received data, generating partial results. After completing these partial computations, each responding member device securely returns its generated partial results to the coordinator via a secure communication channel.
[0040] After receiving all necessary (at least K) partial computation results, the coordinator, within its own hardware-level secure environment, utilizes the partial computation results it generated and received to obtain the final complete cryptographic result through a synthesis algorithm. This synthesis algorithm is based on the adopted secret-sharing scheme (e.g., Shamir secret sharing) and a specific cryptographic algorithm (e.g., Elliptic Curve Digital Signature (ECDSA)). This synthesis algorithm mathematically combines the K partial computation results to obtain a final result identical to that produced by directly performing cryptographic operations using the complete original key S. Throughout this entire synthesis process, the complete form of the original key S is never reconstructed. That is, the original key S never exists or is reconstructed in plaintext form on any device or at any point in time, thus eliminating the risk of complete key leakage.
[0041] The above technical solution effectively solves the coordination problem in distributed collaborative computing and ensures the security of keys in distributed usage scenarios. By introducing a coordinator role and utilizing the secure communication channel provided by the HarmonyOS distributed soft bus for the transmission of requests and partial computation results, an efficient and secure collaborative process is achieved. Each participating device performs partial cryptographic operations in its own hardware-level secure environment, ensuring the security of key fragmentation and the computation process. Crucially, by executing a specific synthesis algorithm in the coordinator's hardware-level secure environment, the partial computation results can be seamlessly synthesized into the final complete cryptographic result, while the complete form of the original key remains unreconstructed throughout this process. This significantly enhances key security in distributed usage scenarios, avoiding the risk of the key being completely exposed on a single node in traditional solutions, thus achieving the principle of never reconstructing the key and providing a solid foundation for sensitive data protection in the HarmonyOS distributed hardware environment.
[0042] To address this, this invention further proposes that when the aforementioned cryptographic operations are Elliptic Curve Digital Signatures (ECDSA) based on the original key S, the aforementioned partial cryptographic operations are partial signature operations. The above method provides a general framework for secure collaborative management and use of keys, enabling cryptographic operations without reconstructing the original key through secret sharing and distributed collaborative computation. However, for specific cryptographic algorithms, especially complex algorithms like Elliptic Curve Digital Signatures (ECDSA), precisely integrating the secret sharing mechanism with the algorithm's internal logic to ensure efficient and secure execution of partial cryptographic operations in a distributed environment, while strictly avoiding the leakage of the original key, is a challenge that needs to be clearly defined and resolved in practical applications.
[0043] To address the aforementioned problems, this invention proposes a distributed collaborative signature method for ECDSA. In ECDSA, the hash value of the data to be signed... It is a fixed-length output after the message has been processed by a hash function, representing the uniqueness of the message. Elliptic curve base point. It is a predefined generation point on an elliptic curve, upon which all public key and signature calculations are based. (Order) It is the base point The order, that is The infinity point (or point at infinity) is a key parameter in the modulo operation of ECDSA, defining the range of values for the private key and the signature. These parameters are public parameters of the ECDSA algorithm and are known to all participating devices.
[0044] During the collaborative signature process, for those holding shards The For each device, the partial signature operation first generates a temporary random number independently within its local hardware-level security environment. .this It is a temporary private key used to generate a random component in the signature. The device then uses this temporary random number. and elliptic curve base point Calculate a point on the elliptic curve (Right now In order to protect For privacy, the device will only Pointed Coordinate components Send to the coordinator. The coordinator is responsible for collecting data from all participating devices. And in accordance with the ECDSA collaborative signature protocol, these Combined into a global random point Coordinate components This global situation It is part of the final signature result, and its synthesis process does not involve any device. Or the original key S was leaked.
[0045] In the global coordination After that, the Each device calculates its partial signature result. Specifically, the first Each device utilizes locally stored key fragments within its local hardware-level security environment. The hash value of the data to be signed The global random point returned by the coordinator Coordinate components and its locally generated temporary random numbers Modular inverse Calculate its partial signature result Its mathematical expression is: .in, It is the first The temporary private key generated locally on each device has a corresponding public key. ; yes In the model Modular inverse; It is the hash value of the message to be signed; It is made by all Global random points generated by synthesis coordinate; It is a fragment of the key held by the device; It is the order of the elliptic curve. This calculation is performed within the device's hardware-level security environment, ensuring... and Sensitive information should not leave the security boundary. This formula indicates that each device only uses its own fragment. Perform partial computation without exposing the fragments themselves. This is done by breaking the original key S into multiple fragments. Furthermore, each device only uses its local fragment for partial computation; the complete form of the original key S never appears on any device, nor is it ever transmitted between devices. Even if an attacker compromises a single device, they can only obtain one fragment of the key. and temporary The original key S cannot be recovered completely, thus greatly enhancing the security of the key.
[0046] Through the above technical solution, this invention provides a refined distributed collaborative signature implementation for Elliptic Curve Digital Signature (ECDSA) cryptographic operations. This solution cleverly decomposes the ECDSA signature process into partial signature operations performed collaboratively by multiple devices, with each device utilizing only its locally stored key fragments. and locally generated temporary random numbers Each component performs some computations within its own hardware-level secure environment. This design ensures that the original key S remains intact throughout the signing process, effectively avoiding the risk of single-point key leakage. Simultaneously, a coordinator collects and synthesizes globally random points. Coordinate components And the signature results calculated independently by each device. Ultimately, through subsequent synthesis steps, a valid signature completely equivalent to a direct signature using the full original key S can be obtained, without any device knowing the full original key S. This not only improves key security but also enhances the attack resistance and robustness of the distributed system, ensuring that the security of the original key S can still be guaranteed even if some devices are compromised.
[0047] In the above embodiments of the present invention, a method for secure collaborative management and use of keys based on HarmonyOS distributed hardware is proposed. Furthermore, it is explained how, when the cryptographic operation is Elliptic Curve Digital Signature (ECDSA), each participating device, within its own hardware-level security environment, utilizes locally stored key fragments to perform partial cryptographic operations on the computational data, generating partial signature results. However, effectively combining these partially generated signature results from different devices into a final complete signature, while ensuring that the complete form of the original key is not reconstructed during the synthesis process, is crucial for achieving distributed secure signatures.
[0048] In response, this invention further proposes a coordinator for synthesizing the final signature. In At that time, using partial signature results Through Lagrange interpolation coefficients Perform a weighted summation: Where Q represents the set of indices of the K devices participating in collaborative computing; These are the Lagrange interpolation coefficients, indexed by the device fragmentation. Calculations show that the following conditions are met. ; It is the first The device returned a partial signature result. This formula guarantees the final synthesized result. With the use of the full private key The directly calculated signatures are completely equivalent, verifying the correctness of the collaborative computation.
[0049] Specifically, the coordinator device receives partially signed results from at least K participating devices. Next, these partial results need to be aggregated to generate the second component s of the ECDSA signature. This aggregation process utilizes the mathematical properties of Shamir's secret sharing. The coordinator will calculate the Lagrange interpolation coefficients for each participating device. These coefficients are based on the key fragmentation index of the participating devices. In a finite field The calculation above mathematically reflects the contribution weight of each fragment to the original key S. This is achieved by verifying the signature results of each part. With the corresponding Lagrange interpolation coefficients Multiply, and modulo all products The final signature component can be obtained by summing the results below. This weighted summation utilizes the linear property of secret sharing, enabling cryptographic operations on the original key S to be performed without explicitly reconstructing the original key S.
[0050] in, It is a collection KA set of device indexes, which are devices that actually participated in part of the signature operation and returned part of the signature result. K This is a preset threshold number, representing the minimum number of fragments required to recover the original key. For a given... K Points each The calculation formula is: These coefficients depend only on the index of the participating devices. It can be computed independently at the coordinator end, without the need for additional communication between devices. This mathematical property indicates that if... K Key fragmentation With the corresponding Lagrange interpolation coefficients By performing a weighted summation, the original key can be accurately recovered from the result. During the signature synthesis process, although the original key... It was not explicitly recovered, but by partially recovering the signature result. Performing a similar weighted summation indirectly utilizes this reconstruction relationship, making the final signature s equivalent to the signature generated using the full key S. Based on the above method, by the first Each device, within its hardware-level security environment, utilizes its local key fragmentation. and temporary random numbers For hash values and global random points coordinate The result is generated after performing partial cryptographic operations. The above formula guarantees that the final synthesized s is completely equivalent to the signature directly calculated using the full private key S, verifying the correctness of the collaborative computation. The signature component s synthesized in this way is mathematically identical to s obtained by directly performing ECDSA signature operations using the full original key S. That is, although the original key S is not reconstructed on any single device, the result of distributed collaborative computation can achieve the same security and effectiveness as centralized key signatures, thus ensuring the cryptographic correctness of the entire distributed signature method.
[0051] Through the above technical solution, the coordinator can utilize the partial signature results returned by each participating device. Combined with Lagrange interpolation coefficients Without reconstructing the original key S, the final signature component s is precisely synthesized through weighted summation. This method cleverly utilizes the linearity of Shamir's secret sharing, making the signature result of distributed collaborative computation mathematically equivalent to the signature directly calculated using the complete private key S. This not only solves the key problem of how to aggregate partial signature results but also further enhances key security. Because the complete form of the original key S remains dispersed throughout the signature generation process and never explicitly appears in any single device or memory, it effectively mitigates the risk of single-point key leakage and significantly improves the overall security of the distributed signature system.
[0052] In the above embodiments of the present invention, distributed key storage and collaborative computation are achieved by dividing the original key into multiple key fragments and securely storing them in a hardware-level security environment of different trusted devices within a collaborative security group. However, in practical applications, the member devices of the collaborative security group may undergo dynamic changes, such as a member device leaving the group for any reason. In this case, if the key fragments are not updated in a timely manner, the old key fragments held by the departed device may still be valid, thereby introducing potential security risks and affecting the key security of the entire collaborative security group.
[0053] To address this, the present invention further proposes a dynamic member management procedure to handle dynamic changes in member devices within a collaborative security group. Specifically, this procedure includes: when a member device leaves the collaborative security group, the system triggers a sharding update protocol. The sharding update protocol ensures that the key security of the collaborative security group can adapt to the dynamic changes in member devices. When a member device exit event is detected, the system automatically initiates the key sharding update process. This can be achieved by the collaborative security group's management module monitoring device status changes, such as device offline events or user-initiated device removal. Once such an event is detected, an instruction to trigger the update protocol is broadcast to the remaining online member devices.
[0054] After the shard update protocol is triggered, the remaining online member devices within the collaborative security group will interact through a secure communication channel to collaboratively generate a new set of key shards to replace the original set. This process allows the remaining online devices to jointly compute and generate new key shards without reconstructing the original keys, through multi-party secure computation. The remaining online devices utilize the secure communication channel provided by the HarmonyOS distributed soft bus for encrypted communication, exchanging necessary information. Each device calculates its corresponding new shard based on its old shards and protocol rules.
[0055] By generating a new set of key fragments, the old key fragments held by the exited device become invalid, while the original key remains unchanged during this process. Even if the exited device still holds the old fragments, these old fragments cannot be combined with the new set to recover the original key, thus invalidating their permissions. Furthermore, the entire update process does not involve plaintext reconstruction of the original key, further ensuring key security. There is a mathematical relationship between the old and new fragment sets, but the old fragments cannot be combined with any preset threshold number K fragments in the new set to recover the original key. The original key exists in a secretly shared form throughout the entire process and never appears in its complete form in any single device or communication link.
[0056] The core operation of the fragmentation update protocol is that each remaining online member device (indexed as...) performs a certain operation. ) Utilizing its held old fragments Collaboratively calculate its corresponding new partition. Its mathematical expression is: .in, It is a set of online devices that execute the update protocol (which must meet the following requirements). ) Based on sets Index of devices Calculated at point The Lagrange interpolation coefficients at the specified location. This operation is logically equivalent to "reconstructing and re-fragmenting" the original key S between devices, but through secure multi-party computation techniques, only the fragments are input by each party. In this case, directly output the new fragment. This ensures that the original key S exists only in fragments throughout the entire protocol execution. Specifically, each online device... According to its index and online device collection Other device indexes Calculate the corresponding Lagrange interpolation coefficients. Then, the equipment From other online devices via a secure communication channel Get its old fragments It then performs a weighted summation operation within a local hardware-level security environment to obtain its new fragment. This process employs a secure multi-party computation protocol to ensure that during the exchange... At the same time, avoid disclosing any information about the original key S.
[0057] Through the aforementioned dynamic member management steps, this invention effectively addresses scenarios involving dynamic changes in member devices within a collaborative security group. When a member device leaves, the system promptly triggers a sharding update protocol, generating a new set of key shards through secure collaborative computation by the remaining online member devices. This process, without reconstructing the original key, immediately invalidates the old key shards held by the departing device, thereby eliminating potential security risks arising from member departures. Simultaneously, because the original key exists in shard form throughout the update process and is never exposed in its complete form, the lifecycle security and attack resistance of the key are greatly enhanced. This mechanism ensures that even with frequent member changes, the key management of the collaborative security group maintains a high level of security and robustness.
[0058] This invention proposes a method for secure collaborative management and use of keys based on HarmonyOS distributed hardware. By dividing the original key into multiple key fragments and distributing them across different trusted devices within a collaborative security group's hardware-level security environment, distributed key management and collaborative computation are achieved. However, in practical applications, member devices within the collaborative security group may fail for various reasons, resulting in the loss of their stored key fragments. If not handled promptly, this may reduce system redundancy, and even, if the number of lost key fragments reaches a certain level, the system may fail to meet the preset threshold K, thus preventing the recovery of the original key or the execution of cryptographic operations, impacting service availability and security.
[0059] To address this issue, the present invention further proposes a key fragment recovery step to handle situations where key fragments are lost due to member device failure within a collaborative security group. This ensures that even if some devices malfunction, the system can still maintain key availability and security, preventing the collapse or service interruption of the entire key management system due to device failure. Specifically, when a member device fails, resulting in the loss of its stored key fragments, and the number of currently active member devices is not less than the preset threshold K, the system will trigger a key recovery protocol. Member device failure can refer to situations such as hardware damage, software system crashes, theft or loss of the device, or prolonged network connection interruption preventing participation in collaboration. When a device fails, the key fragments stored in its hardware-level security environment will be inaccessible or considered permanently lost. The preset threshold K is a core parameter of the secret sharing algorithm, representing the minimum number of key fragments required to recover the original key. This condition ensures that when the recovery protocol is triggered, there are still a sufficient number of active member devices in the collaborative security group holding enough key fragments to recover the original key through the reconstruction characteristics of the secret sharing algorithm. If the number of active devices is less than K, the original key cannot be recovered, and a higher level of disaster recovery mechanism may be required. The key recovery protocol is a series of pre-defined, automatic or semi-automatic processes used to coordinate the remaining valid member devices to jointly recover and redistribute the key. The protocol is triggered by system monitoring of a device going offline, a device fault report, or manual initiation by the administrator.
[0060] After the key recovery protocol is triggered, the active member devices interact securely through a secure communication channel to collaboratively recover the original key temporarily from memory. This secure communication channel, such as the one provided by the HarmonyOS distributed soft bus, ensures that key fragment information or intermediate calculation results transmitted between devices during the key recovery process are not eavesdropped on or tampered with, thus maintaining the confidentiality and integrity of the entire recovery process. Using their respective key fragments, the active member devices perform collaborative calculations in their respective hardware-level secure environments through the inverse operation of a secret sharing algorithm (such as Lagrange interpolation), ultimately reconstructing the original key from memory within the hardware-level secure environment of one or more devices.
[0061] Subsequently, the system will immediately re-execute the secret sharing algorithm and key fragment secure storage steps based on the recovered original key to generate and store a new set of key fragments among the valid member devices. Once the original key is temporarily recovered in memory, the system will immediately use it to re-execute the secret sharing algorithm to generate a completely new set of key fragments. These new key fragments are then securely distributed and stored in the hardware-level security environment of all currently valid member devices. Finally, the system will then erase the original key from memory. After the new key fragment set is generated and securely stored, the temporarily recovered original key in memory is immediately erased without leaving any trace. This further strengthens key security, ensuring that the complete form of the original key is never persistently stored, and even during the recovery process, it only exists briefly in a protected memory area.
[0062] Through the above technical solution, this invention provides a key fragment recovery mechanism, effectively solving the problem of key fragment loss due to member device failure in a distributed key management system. When some member devices fail, as long as the number of remaining valid member devices still meets a preset threshold K, the system can temporarily recover the original key in memory through collaborative computation without persistently storing the original key. Subsequently, the system can immediately regenerate and distribute a new set of key fragments to all currently valid member devices based on the temporarily recovered original key, thereby quickly rebuilding the distributed secure storage state of the key. This process ensures that even after device failure, the availability of the key, the redundancy of the system, and the overall security can still be effectively maintained, avoiding the risk of paralyzing the entire key management system due to local device failure, and greatly improving the system's fault tolerance and business continuity. At the same time, the complete form of the original key only exists briefly in the memory of the hardware-level secure environment and is immediately deleted after redistribution, following the principle of non-persistent key storage and ensuring key confidentiality.
[0063] In the above embodiments of the present invention, by dividing the original key into multiple key fragments and distributing them across hardware-level security environments on different trusted devices, distributed key management and collaborative use are achieved, effectively improving key security. However, this method requires a specific carrier to carry and execute it. If a physical entity capable of reliably carrying and efficiently executing the method is lacking, its practical application and promotion will be limited, making it difficult to fully leverage its advantages in distributed security scenarios.
[0064] To address this issue, the present invention proposes an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it can implement the aforementioned key security collaborative management and usage method based on HarmonyOS distributed hardware.
[0065] Specifically, electronic devices refer to hardware entities with computing, storage, and communication capabilities, such as smartphones, tablets, smart wearable devices, smart home devices, and in-vehicle terminals. As a physical platform carrying and executing methods for secure collaborative management and use of keys, this electronic device can be an independent smart terminal or a node in a distributed system. It integrates the necessary hardware components and software environment to support the operation of the HarmonyOS operating system and the realization of its distributed capabilities.
[0066] Memory is a hardware component in electronic devices used to store data and instructions, including but not limited to Random Access Memory (RAM), Read-Only Memory (ROM), and Flash Memory. Its main function is to store computer programs and various data generated during program execution, such as key fragments, computation data, and partial computation results. Memory is divided into main memory and auxiliary memory based on its function and access speed. Main memory is used for fast program loading and execution, while auxiliary memory is used for persistent data storage. In the HarmonyOS distributed hardware environment, memory also needs to support secure data interaction with the hardware-level security environment.
[0067] The processor is the core computing unit of an electronic device, responsible for executing instructions in a computer program and performing data processing and control operations. As the computing core for executing the aforementioned key security collaborative management and usage method, the processor is responsible for parsing and executing various instructions in the computer program, driving the entire method's operation. The processor can be a central processing unit (CPU), graphics processing unit (GPU), digital signal processor (DSP), or a dedicated security processor, etc., possessing sufficient computing power and security features to support the operation of the HarmonyOS operating system and perform cryptographic operations in a hardware-level security environment.
[0068] A computer program is a collection of instructions that guides a computer to perform a specific task. This computer program carries and implements the specific logic and steps of the key security collaborative management and usage method based on HarmonyOS distributed hardware. This program can exist in the form of an application (App), system service, firmware, or driver, and its code is compiled and stored in memory, awaiting processor execution. This program needs to interact with the distributed capability interface of the HarmonyOS operating system to utilize its unified identity authentication, distributed device mutual trust, and distributed soft bus functions.
[0069] When a user or system triggers a key management or usage request, the processor loads and runs the computer program stored in memory. This program invokes the underlying interfaces and distributed capabilities of the HarmonyOS operating system to coordinate the hardware-level security environment within the electronic device and secure communication with other members of the collaborative security group. This enables a series of operations, including key fragment generation, storage, collaborative computation, dynamic management, and recovery. For example, when responding to a user command to form a collaborative security group, the program invokes HarmonyOS's unified identity authentication and distributed device trust capabilities; during the generation, storage, and collaborative computation of key fragments, the program coordinates the processor, memory, and hardware-level security environment, and utilizes a distributed soft bus for secure communication.
[0070] By providing a specific electronic device as a platform, this invention transforms the method of secure collaborative management and use of keys into a practically deployable and operational function. This electronic device executes pre-stored computer programs through its processor, fully leveraging the distributed capabilities of the HarmonyOS operating system and the device's own hardware-level security environment to achieve key fragmentation generation, secure storage, collaborative computation, and dynamic management. This allows key lifecycle management to move beyond being limited to a single device and instead be performed across multiple trusted devices in a highly secure and collaborative manner, effectively reducing the risk of single-point key leakage. Furthermore, because the method is implemented on a specific electronic device, users or applications can easily initiate key operation requests and obtain the final cryptographic result through inter-device collaborative computation without worrying about the original key being completely reconstructed at any stage, greatly improving the flexibility, security, and reliability of key usage.
[0071] The present invention also provides an embodiment of a practical application of the method of the present invention: I. Application Scenarios: This study focuses on a scenario where a senior executive of a company securely signs an important electronic contract across multiple devices within a smart office environment. The user has three terminal devices equipped with HarmonyOS 4.0 or later and possessing hardware-level security (TEE) capabilities: 1. Main device H: Huawei Mate 60 Pro smartphone (as the daily main device and coordinator).
[0072] 2. Device P: Huawei MatePad Pro tablet (as an office display and processing device).
[0073] 3. From device W: Huawei Watch4 smartwatch (as a personal authentication device).
[0074] Users wish to review contracts on their tablets and then securely and conveniently complete the signing process without transmitting the signing key to the tablet. This embodiment will demonstrate how the above method can securely complete this distributed signing while ensuring that the key never leaves the hardware security environment of each device and its complete form is never reconstructed.
[0075] II. Specific Implementation and Calculation Processes for Each Stage: S1: Establishing Trust in the Collaborative Security Group: 1. Device Discovery and Authentication: The user initiates the "Create Collaborative Security Group" command on the mobile phone (H). The mobile phone automatically discovers and lists nearby tablets (P) and watches (W) that are logged into the same Huawei account via the HarmonyOS distributed soft bus based on Wi-Fi P2P and Bluetooth.
[0076] 2. Hardware security environment verification: The system background automatically verifies that all three devices have a compliant Trusted Execution Environment (TEE).
[0077] 3. User Confirmation and Network Setup: The user confirms on the mobile phone interface that the tablet (P) and watch (W) have been added to the security group. HarmonyOS's unified identity authentication and distributed device trust mechanism establish a trust chain based on hardware identity for the three devices.
[0078] 4. Configuration Information Generation and Storage: The system generates configuration information: Group_ID: G-001, Members: ThresholdK=2, TotalN=3. This information is encrypted separately and securely stored in the TEE of each of the three devices.
[0079] S2: Key generation and fragmented secure storage 1. Initial Key Generation: The user confirms the generation of an ECC key pair for electronic signature on the mobile phone (H). This operation is performed within the TEE of the mobile phone (H), generating: Private key S (original key, a 256-bit large integer, for example: S=0x6B8F5E..., this is just an example, and the abstract value S will be used to refer to it in the following text).
[0080] Corresponding public key (G is the base point of the secp256r1 curve).
[0081] 2. Secret Sharing Fragment: Immediately invoke the Shamir Secret Sharing Algorithm (2,3) threshold scheme within the TEE of the mobile phone (H).
[0082] Choose a large prime number (equal to curve order) ).
[0083] Construct a random first-degree polynomial: ,in The coefficients are randomly generated within the TEE.
[0084] Assign shard indexes to the three devices: .
[0085] Calculate the three key fragments: / / Phone for personal use only / / To be distributed to tablets, / / To be distributed to the watch, 3. Secure fragmented distribution: The TEE of the mobile phone (H) establishes an end-to-end encrypted channel through the HarmonyOS distributed soft bus to transmit fragments. The TEE, which is securely transmitted to the tablet (P), will be fragmented. Securely transmit TEE to the watch (W).
[0086] After the TEE from the tablet (P) and watch (W) is received, and Persistent storage is performed in its own secure storage area.
[0087] 4. Original Key Removal: After fragment distribution is completed, the TEE of the mobile phone (H) immediately and completely removes the complete private key S and polynomial coefficients. At this point, the complete private key S no longer exists in the persistent storage of any device in the world.
[0088] S3 & S4: Collaborative Signatures Without Full Key Reconstruction (ECDSA as an Example) 1. Signature Request Initiation: The user completes the contract review on the tablet (P) and clicks "Sign with Distributed Key". The tablet (P) acts as the coordinator for this operation.
[0089] The tablet (P) calculates the hash value of the contract document. .
[0090] A "cooperative signature request," containing a hash value, is broadcast to the mobile phone (H) and watch (W) within the cooperative security group via a distributed soft bus. .
[0091] 2. Partial signature calculation: The three devices perform partial signature calculations in parallel within their local TEEs, using the key fragments stored in each device.
[0092] Step 1: Generate temporary random numbers and exchange commitments Each device Generate a temporary random number within the TEE. ,calculate .
[0093] Each device will of coordinate Send to the coordinator (Tablet P).
[0094] Step 2: Synthesize global random points The coordinator (Plate P) collected Then, synthesize the global version. (Elliptic curve point addition). Record. of Coordinates are ,this It will be part of the final signature.
[0095] The coordinator will Broadcast to cell phone (H) and watch (W).
[0096] Step 3: Calculate partial signature Each device Within the TEE, local fragmentation is used. Calculate the partial signature result :
[0097] Each device will calculate Send back to the coordinator (Plate P).
[0098] 3. Signature Synthesis: The coordinator (Plate P) collects signatures within its own TEE. .
[0099] Because a (2, 3) threshold is used, only any two partial signatures are needed for synthesis. This example uses all three to enhance robustness.
[0100] The coordinator calculates the Lagrange interpolation coefficients. (Based on device index) For example, using hour:
[0101]
[0102] Synthesize the final signature s: Based on the linear property of secret sharing, the result of this operation is equivalent to the signature computed using the full private key S: (where k is the synthesized temporary private key).
[0103] Final output: The flat panel (P) yields a standard ECDSA signature pair. The signature verifier uses the public key. This signature can be verified without being detected that it was generated by the distributed collaboration of three devices.
[0104] (iv) Dynamic security management demonstration: 1. Scenario: Device removal (Watch W lost) The user removes the watch (W) from the collaborative security group on the phone (H).
[0105] The system triggers the fragmented update protocol. The TEE of the mobile phone (H) and the tablet (P) interact through a secure channel.
[0106] The two parties collaborate to perform a secure multi-party computation, generating new key fragments for each other. and And overwrite the old fragments.
[0107] Effect: Old fragments stored on the watch (W) It becomes immediately invalid, and even if picked up by someone else, it cannot participate in any collaborative operations. The complete key S remains unchanged, and the remaining devices (H,P) in the group can continue to work collaboratively at the (2,2) threshold.
[0108] 2. Scenario: Key fragment recovery (accidental damage to tablet P) Assuming the tablet (P) is damaged and cannot be powered on, its internal components... Lost. At this point, only the mobile phone (H) and watch (W) remain as valid devices, and the quantity 2 equals the threshold K=2.
[0109] The user initiates the "key recovery" process on the mobile phone (H).
[0110] The TEE of the mobile phone (H) and the watch (W) exchange necessary intermediate information through a secure channel, and use the Shamir algorithm to temporarily reconstruct the complete private key S in memory.
[0111] The system immediately uses this temporary key S to re-execute the (2,3) secret share for the two currently valid devices and a newly added backup device, generating and distributing a completely new set of shards.
[0112] Recovery complete: The full key S in temporary memory is immediately cleared. The key is then securely "regenerated" in the new device portfolio, enabling distributed backup and recovery.
[0113] III. Comparison of Results and Conclusions: 1. Comparison with traditional solutions:
[0114] 2. Conclusion of this embodiment: This application leverages HarmonyOS's distributed capabilities to establish a collaborative security group, securely sharding and storing the signing key in TEEs on the phone, tablet, and watch. When a user initiates a contract signing on the tablet, the three devices successfully collaboratively complete a standard-compliant ECDSA digital signature without reconstructing the key's integrity. The subsequent demonstration of dynamic management further proves that this solution can maintain key security and business continuity even in the event of device loss or damage.
[0115] Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art or related fields based on the embodiments of the present invention without inventive effort should fall within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described and explained in the present invention, unless otherwise specified or limited, shall be implemented according to conventional means in the art.
Claims
1. A method for secure collaborative management and use of keys based on HarmonyOS distributed hardware, characterized in that: Includes the following steps: S1. Responding to user commands, based on the unified identity authentication and distributed device mutual trust capabilities of the HarmonyOS operating system, multiple authenticated trusted devices with hardware-level security environments are grouped into a collaborative security group; S2. Within the collaborative security group, an original key is generated, and the original key is divided into multiple key fragments using a secret sharing algorithm. The secret sharing algorithm is configured such that at least one preset threshold number (K) of key fragments is required to recover the original key. S3. Each of the key fragments is securely stored in the hardware-level security environment of different trusted devices within the collaborative security group through a secure communication channel provided by HarmonyOS distributed soft bus, so that each trusted device only persistently stores one key fragment that cannot be individually restored from the original key; S4. In response to a cryptographic operation request for the original key, multiple trusted devices within the collaborative security group that meet at least the preset threshold number (K) perform collaborative computation: each participating device performs partial cryptographic operations on the computation data based on locally stored key fragments in its own hardware-level security environment, generating partial computation results; S5. Securely aggregate the partial computation results generated by each participating device and synthesize them into the final complete cryptographic computation result in a hardware-level secure environment; Wherein, after the original key is split, its complete form is not reconstructed in any storage, communication and collaborative computing process of the collaborative security group.
2. The key security collaborative management and usage method based on HarmonyOS distributed hardware according to claim 1, characterized in that, The hardware-level security environment is the trusted execution environment (TEE) or security chip (SE) of the device; the step of forming a collaborative security group also includes encrypting and storing configuration data containing the identity information of member devices in the hardware-level security environment of each member device.
3. The key security collaborative management and usage method based on HarmonyOS distributed hardware according to claim 1, characterized in that, The step of generating and splitting the original key is performed in a hardware-level security environment of a master device, generating N key fragments and setting a recovery threshold of K, satisfying K≤N; the secure storage step includes: the master device distributes (N-1) key fragments to other slave devices through the secure communication channel, and then clears the original key stored in itself.
4. The key security collaborative management and usage method based on HarmonyOS distributed hardware according to claim 3, characterized in that, The method of segmenting the original key using the secret sharing algorithm is implemented using the (K, N) threshold of Shamir's secret sharing. Specifically, a random (K-1) degree polynomial is constructed over the finite field GF(p), where the constant term is the original key (S), thereby generating N fragments; the fragment data held by any device is... ,in This is a sharding index; the mathematical expression of the polynomial is: ; in, The original key to be segmented is represented as a constant term in the polynomial; In a finite field The coefficients are randomly selected to ensure the randomness and security of the sharding. It is a large prime number, and defines a finite field for operations; It is the independent variable; different non-zero values are substituted into it. The corresponding fragment value can then be calculated. ; The recovery threshold.
5. The key security collaborative management and usage method based on HarmonyOS distributed hardware according to claim 4, characterized in that, The collaborative computing steps specifically include: Any member device within the collaborative security group acts as a coordinator, sending collaborative computing requests and data to be computed to at least (K-1) other member devices through the secure communication channel; Each responding member device, within its own hardware-level security environment, uses locally stored key fragments to perform partial cryptographic operations on the data to be processed, generates partial operation results, and returns them to the coordinator. The coordinator, within its own hardware-level security environment, utilizes the partial computation results it generates and receives to obtain the final complete cryptographic computation result through a synthesis algorithm. The mathematical expression of the synthesis algorithm is as follows: ; in, Indicates participation in collaborative computing A collection of indexes for each device; Indicates the first Each device fragments its key within a local security environment. The partial calculation results derived from the input data; This represents a deterministic composition function corresponding to the underlying secret sharing scheme and cryptographic algorithm.
6. The key security collaborative management and usage method based on HarmonyOS distributed hardware according to claim 5, characterized in that, When the cryptographic operation is based on the original key When using Elliptic Curve Digital Signature (ECDSA), the partial cryptographic operation is a partial signature operation; let the hash of the data to be signed be... The base point of the elliptic curve is , level For holding shards The For each device, its partial signature operation is as follows: First, a temporary random number is generated locally. ,calculate and will of Coordinate components Send to the coordinator; the coordinator collects and synthesizes the global ones. Subsequently, the first Each device calculates its partial signature result. : ; in, It is the first The temporary private key generated locally on each device has a corresponding public key. ; yes In the model Modular inverse; It is the hash value of the message to be signed; It is made by all Global random points generated by synthesis coordinate; It is a fragment of the key held by the device; It is the order of the elliptic curve.
7. The key security collaborative management and usage method based on HarmonyOS distributed hardware according to claim 6, characterized in that, The coordinator synthesizes the final signature. In At that time, using the aforementioned partial signature result Through Lagrange interpolation coefficients Perform a weighted summation: ; in, Indicates participation in collaborative computing K A collection of indexes for each device; These are the Lagrange interpolation coefficients, indexed by the device fragmentation. Calculations show that the following conditions are met. (i.e., the reconstruction relationship of the secret key); It is the first The device returned a partial signature result.
8. The method for secure collaborative management and use of keys based on HarmonyOS distributed hardware according to claim 1, characterized in that, It also includes dynamic member management steps: When a member device leaves the collaborative security group, the fragmentation update protocol is triggered; The remaining online member devices within the collaborative security group interact through the secure communication channel to collaboratively generate a new set of key fragments to replace the original set of key fragments, thereby invalidating the old key fragments held by the exited devices, while the original key remains unchanged during this process. The core operation of the fragmentation update protocol is that each remaining online member device (indexed as...) performs a certain operation. ) Utilizing its held old fragments Collaboratively calculate its corresponding new partition. Its mathematical expression is: ; in, It is a set of online devices that execute the update protocol (which must meet the following requirements). ; Based on sets Index of devices Calculated at point The Lagrange interpolation coefficients at that location.
9. The key security collaborative management and usage method based on HarmonyOS distributed hardware according to claim 1, characterized in that, It also includes the key fragment recovery step: When a member device fails, causing the loss of its stored key fragments, and the number of currently valid member devices is not less than the preset threshold K, the key recovery protocol is triggered. The valid member devices interact securely through the secure communication channel and collaboratively recover the original key temporarily from memory; Immediately based on the recovered original key, the secret sharing algorithm and key fragment secure storage steps are re-executed to generate and store a new set of key fragments among the valid member devices, and then the original key in memory is cleared.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the key security collaborative management and usage method based on HarmonyOS distributed hardware as described in any one of claims 1 to 9.