Hybrid signature method, signature verification method, and electronic device
By combining traditional and post-quantum cryptographic algorithms in a trusted execution environment to generate hybrid digital signatures, the problem of traditional cryptographic algorithms being easily cracked by quantum computers is solved, and message transmission with higher security is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-04-03
- Publication Date
- 2026-06-02
AI Technical Summary
Traditional cryptographic algorithms are vulnerable to being cracked by large-scale quantum computers, making secure transmission protocols based on traditional cryptographic algorithms unable to prevent security threats posed by quantum computers.
A hybrid signature method is adopted. A first digital signature is obtained by performing a signature operation using a traditional cryptographic algorithm in a first trusted execution environment. Then, a post-quantum cryptographic algorithm is used to perform a signature operation in a second trusted execution environment. Finally, the two signatures are concatenated to generate a hybrid digital signature.
It significantly improves the security of message transmission, prevents quantum computer attacks, and ensures the integrity and privacy of information transmission.
Smart Images

Figure CN120825289B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of key technology, and in particular to a hybrid signature method, a signature verification method, and an electronic device. Background Technology
[0002] When signing messages using a trusted execution environment, the signing operation is typically based on traditional cryptographic algorithms (such as the DES cryptographic algorithm).
[0003] Traditional cryptographic algorithms are vulnerable to being cracked by large-scale quantum computers, therefore secure transmission protocols based on traditional cryptographic algorithms cannot prevent security threats posed by quantum computers. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a hybrid signature method, an electronic device, and a computer-readable storage medium. In this method, a first digital signature is obtained by inputting the target message to be signed into a first trusted execution environment for signing based on a traditional cryptographic algorithm. Then, the target message and the first digital signature are input into a second trusted execution environment for signing based on post-quantum cryptography to obtain a second digital signature. Finally, the first and second digital signatures are concatenated to obtain a hybrid digital signature. Using different cryptographic algorithms to perform signing operations to obtain a hybrid digital signature significantly improves the security of message transmission.
[0005] In a first aspect, embodiments of this application provide a hybrid signature method applied to an electronic device. The method includes: using a target message to be signed as first input data of a first trusted execution environment; using the first trusted execution environment to perform a signature operation on the first input data based on a traditional cryptographic algorithm to obtain a first digital signature; using the target message and the first digital signature as second input data of a second trusted execution environment; using the second trusted execution environment to perform a signature operation on the second input data based on a post-quantum cryptographic algorithm to obtain a second digital signature; and concatenating the first digital signature and the second digital signature to obtain a hybrid digital signature for the target message.
[0006] The target message is signed sequentially using both traditional cryptographic algorithms and post-quantum cryptographic algorithms to obtain a hybrid digital signature. Since traditional and post-quantum cryptographic algorithms belong to two independent key systems, the hybrid digital signature obtained by the method in this application significantly improves the security of message transmission.
[0007] According to the first aspect, the method further includes: using the first trusted execution environment to generate a first signature key pair based on the conventional cryptographic algorithm, the first signature key pair including a first signing private key and a first verification public key; and using the second trusted execution environment to generate a second signature key pair based on the post-quantum cryptographic algorithm, the second signature key pair including a second signing private key and a second verification public key. The conventional cryptographic algorithm includes cryptographic algorithms other than the post-quantum cryptographic algorithm.
[0008] According to the first aspect, or any implementation thereof, the step of using the first trusted execution environment to perform a signature operation on the first input data based on a traditional cryptographic algorithm to obtain a first digital signature includes: in the first trusted execution environment, signing the first input data using the first signing private key to obtain the first digital signature. The step of using the target message and the first digital signature as second input data in a second trusted execution environment, and using the second trusted execution environment to perform a signature operation on the second input data based on a post-quantum cryptographic algorithm to obtain a second digital signature includes: concatenating the target message and the first digital signature to obtain an intermediate signature value, which is used as the second input data; in the second trusted execution environment, signing the intermediate signature value using the second signing private key to obtain the second digital signature.
[0009] According to the first aspect, or any implementation of the first aspect above, the step of signing the intermediate signature value using the second signing private key in the second trusted execution environment to obtain the second digital signature includes: performing a hash calculation on the intermediate signature value in the second trusted execution environment to obtain a message digest of a preset length; and signing the message digest using the second signing private key to obtain the second digital signature.
[0010] According to the first aspect, or any implementation of the first aspect above, the method further includes: uploading the first verification public key and the second verification public key to a key management platform, wherein the key management platform is a cloud service platform composed of a computer cluster.
[0011] Secondly, embodiments of this application provide a signature verification method applied to an electronic device. The method includes: in response to a received signed target message, sending a key acquisition request to a key management platform, wherein the key acquisition request carries identification information of the message sender, and the signed target message has a hybrid digital signature; receiving multiple verification public keys returned by the key management platform that match the identification information; parsing the hybrid digital signature to obtain multiple digital signatures based on different cryptographic algorithms; verifying corresponding digital signatures among the multiple digital signatures using each of the verification public keys in multiple trusted execution environments; and, if all of the digital signatures pass verification, treating the target message as valid data.
[0012] According to the second aspect, receiving multiple verification public keys matching the identification information returned by the key management platform includes: receiving a first verification public key based on a traditional cryptographic algorithm and a second verification public key based on a post-quantum cryptographic algorithm returned by the key management platform. Parsing the hybrid digital signature to obtain multiple digital signatures based on different cryptographic algorithms includes: parsing the hybrid digital signature to obtain a first digital signature based on the traditional cryptographic algorithm and a second digital signature based on the post-quantum cryptographic algorithm. The traditional cryptographic algorithm includes cryptographic algorithms other than the post-quantum cryptographic algorithm.
[0013] According to the second aspect, or any implementation thereof, the step of verifying the corresponding digital signature among the plurality of digital signatures using each of the verification public keys in multiple trusted execution environments includes: using the target message, the first digital signature, and the first verification public key as third input data in a first trusted execution environment, performing signature verification based on the third input data in the first trusted execution environment to obtain a first verification result; and using the target message, the first digital signature, the second digital signature, and the second verification public key as fourth input data in a second trusted execution environment, performing signature verification based on the fourth input data in the second trusted execution environment to obtain a second verification result.
[0014] According to the second aspect, or any implementation of the second aspect above, the step of treating the target message as valid data when all the digital signatures have been verified successfully includes: treating the target message as valid data when both the first verification result and the second verification result indicate that the verification has been successful.
[0015] Thirdly, embodiments of this application provide an electronic device, including: one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: taking a target message to be signed as first input data of a first trusted execution environment, and using the first trusted execution environment to perform a signature operation on the first input data based on a traditional cryptographic algorithm to obtain a first digital signature; taking the target message and the first digital signature as second input data of a second trusted execution environment, and using the second trusted execution environment to perform a signature operation on the second input data based on a post-quantum cryptographic algorithm to obtain a second digital signature; and concatenating the first digital signature and the second digital signature to obtain a hybrid digital signature for the target message.
[0016] Fourthly, embodiments of this application provide an electronic device, including: one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: in response to a received signed target message, sending a key acquisition request to a key management platform, wherein the key acquisition request carries identification information of the message sender, and the signed target message has a hybrid digital signature; receiving multiple verification public keys returned by the key management platform that match the identification information; parsing the hybrid digital signature to obtain multiple digital signatures based on different cryptographic algorithms; verifying corresponding digital signatures among the multiple digital signatures using each of the verification public keys in multiple trusted execution environments; and, if all of the digital signatures are verified successfully, treating the target message as valid data.
[0017] The second to fourth aspects and any one of their implementations correspond to the first aspect and any one of its implementations, respectively. The technical effects of the second to fourth aspects and any one of their implementations can be found in the technical effects of the first aspect and any one of its implementations, as described above, and will not be repeated here.
[0018] Fifthly, embodiments of this application provide a computer-readable medium for storing a computer program, the computer program including instructions for performing the method in the first aspect or any possible implementation of the first aspect.
[0019] In a sixth aspect, embodiments of this application provide a computer program including instructions for performing the method in the first aspect or any possible implementation thereof.
[0020] In a seventh aspect, embodiments of this application provide a chip including a processing circuit and transceiver pins. The transceiver pins and the processing circuit communicate with each other via an internal connection path. The processing circuit executes the method in the first aspect or any possible implementation of the first aspect to control the receiving pin to receive signals and to control the transmitting pin to transmit signals. Attached Figure Description
[0021] Figure 1 This is an example illustration of an application scenario;
[0022] Figure 2 This is a schematic diagram of the structure of an electronic device as an example.
[0023] Figure 3 A software architecture block diagram of an electronic device as an example;
[0024] Figure 4 A flowchart of a hybrid signature process provided in this application embodiment;
[0025] Figure 5 A schematic diagram of the hybrid signature process provided in an embodiment of this application;
[0026] Figure 6 This is a flowchart illustrating a hybrid digital signature verification process provided in an embodiment of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0029] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.
[0030] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0031] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.
[0032] Before describing the technical solutions of the embodiments of this application, the application scenarios of the embodiments of this application will first be described with reference to the accompanying drawings. For example... Figure 1 The diagram shown is an application scenario illustration provided by an embodiment of this application. Figure 1 As shown, in order to ensure the security of message transmission during the message transmission process, the sender 10 can use the Trusted Execution Environment (TEE environment) 12 to sign the message before sending it to the receiver 11, obtain the signed message, and then send the signed message to the receiver 11.
[0033] When signing messages using a trusted execution environment, the signing operation is usually based on traditional cryptographic algorithms (such as public-key algorithms). However, traditional cryptographic algorithms are vulnerable to being cracked by large quantum computers. Therefore, secure transmission protocols based on traditional cryptographic algorithms cannot prevent security threats posed by quantum computers.
[0034] This application provides a hybrid signature method applicable to electronic devices. The electronic device uses the target message to be signed as first input data to a first trusted execution environment. Using the first trusted execution environment, it performs a signature operation based on a traditional cryptographic algorithm on the first input data to obtain a first digital signature. The electronic device then uses the target message and the first digital signature as second input data to a second trusted execution environment. Using the second trusted execution environment, it performs a signature operation based on a post-quantum cryptographic algorithm on the second input data to obtain a second digital signature. The electronic device concatenates the first and second digital signatures to obtain a hybrid digital signature for the target message. Hybrid signatures can significantly improve the security of message transmission.
[0035] Electronic devices may include mobile phones, tablets, smartwatches, laptops, autonomous vehicles, smart home devices, machine navigation devices, and virtual-real fusion devices. The embodiments of this application can be applied to various scenarios requiring message transmission.
[0036] like Figure 2The diagram shows the structure of electronic device 100. Optionally, electronic device 100 can be referred to as a terminal or a terminal device. The specific product form of electronic device 100 can be a smart terminal, such as a mobile phone, tablet computer, wearable device, augmented reality / virtual reality device, laptop computer, in-vehicle device, personal digital assistant (PDA), or other electronic devices with file-sharing functions. Specifically, the functional modules involved in this application can be deployed on the DSP chip of the relevant device, specifically as applications or software. A file-sharing function can be implemented through software installation or upgrades, and through hardware calls and coordination.
[0037] It should be understood that, Figure 2 The electronic device 100 shown is only one example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations. Figure 2 The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0038] Electronic device 100 may include: processor 110, memory 200, mobile communication module 130, wireless communication module 140, sensor module 150, button 160, motor 161, indicator 162, camera 163, and display screen 164. Sensor module 150 may include pressure sensor, gyroscope sensor, accelerometer, temperature sensor, motion sensor, barometric pressure sensor, magnetic sensor, distance sensor, proximity sensor, fingerprint sensor, touch sensor, ambient light sensor, bone conduction sensor, etc.
[0039] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0040] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.
[0041] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 130, wireless communication module 140, modem processor, and baseband processor.
[0042] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization.
[0043] The mobile communication module 130 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 130 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
[0044] The wireless communication module 140 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
[0045] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 130, and antenna 2 is coupled to wireless communication module 140, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.
[0046] Electronic device 100 implements display functions through a GPU, display screen 164, and application processor. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0047] The display screen 164 is used to display images, videos, etc., and the display screen 164 includes a display panel. In some embodiments, the electronic device 100 may include one or N display screens 164, where N is a positive integer greater than 1.
[0048] Electronic device 100 can perform shooting functions through ISP, camera 163, video codec, GPU, display screen 164 and application processor.
[0049] The ISP (Image Signal Processor) is used to process data fed back from the camera 163. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 163.
[0050] Camera 163 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard formats such as RGB and YUV. In some embodiments, the electronic device 100 may include one or N cameras 163, where N is a positive integer greater than 1.
[0051] The camera 163 can be located at the edge of the electronic device, and can be an under-display camera or a pop-up camera. The camera 163 can include a front-facing camera or a rear-facing camera. This application embodiment does not limit the specific location and shape of the camera 163. The electronic device 100 can include one or more cameras with different focal lengths, such as telephoto cameras, wide-angle cameras, ultra-wide-angle cameras, or panoramic cameras.
[0052] The memory 120 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the memory 120, such as enabling the electronic device 100 to implement the file sharing method in the embodiments of this application. The memory 120 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device 100, etc. Furthermore, the memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0053] A touch sensor, also known as a "touch panel," can be located on the display screen 164. The touch sensor and display screen 164 together form a touchscreen, also called a "touch screen." The touch sensor detects touch operations applied to or near it. The touch sensor can then transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 164.
[0054] A pressure sensor is used to sense pressure signals and can convert these signals into electrical signals. In some embodiments, the pressure sensor may be located on the display screen 164. The electronic device 100 may also calculate the position of a touch based on the detection signal from the pressure sensor.
[0055] A gyroscope sensor can be used to determine the motion attitude of an electronic device 100. In some embodiments, the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor.
[0056] An accelerometer can detect the magnitude of acceleration of an electronic device 100 in various directions (typically three axes). When the electronic device 100 is stationary, the accelerometer can detect the magnitude and direction of gravity. Accelerometers can also be used to identify the posture of electronic devices, and are applied in applications such as screen orientation switching and pedometers.
[0057] Buttons 160 include a power button, volume buttons, etc. Buttons 160 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0058] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to illustrate the software structure of electronic device 100.
[0059] like Figure 3 The software architecture diagram of the illustrative electronic device 100 illustrates a layered architecture that divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system layer, and the kernel layer.
[0060] The application layer can include a series of application packages, such as Figure 3 As shown, the application package may include applications such as a camera, gallery, instant messaging application, and quantum-safe envelope. Instant messaging applications are applications that enable real-time communication via the internet, allowing users to communicate in real time through text messages, voice calls, video calls, etc. Common instant messaging applications include WeChat, QQ, and WhatsApp. Quantum-safe envelopes can protect the privacy and security of communication content through quantum encryption technology, and can securely generate and distribute encryption keys through quantum key distribution protocols, providing a secure and reliable end-to-end encryption function.
[0061] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer, including various components and services to support Android development. The application framework layer includes some predefined functions. For example... Figure 3 As shown, the application framework layer can include a window manager, content provider, notification manager, resource manager, and file sharing application, etc.
[0062] The window manager is used to manage windowed applications. It can retrieve screen size, determine if a status bar is present, lock the screen, and capture screenshots, among other things.
[0063] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.
[0064] File Explorer can provide applications with various resources, such as localized strings, icons, images, layout files, video files, and so on.
[0065] The notification manager allows applications to display notifications in the status bar. These notifications can be used to convey informational messages and can disappear automatically after a short pause, requiring no user interaction. Examples include notifications of download completion and message alerts. Notifications can also appear as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include text messages in the status bar, sound alerts, vibrations, and flashing indicator lights.
[0066] File-sharing applications can provide key management and encryption / decryption functions, such as key generation and distribution, encrypted file transfer, encrypted message transmission, multi-factor authentication, and customized access control. When a user uses a file-sharing application for the first time, the application automatically generates an encryption key pair and a signing key pair that match the user's identification information, and uploads the encryption public key and signing public key to the key management platform.
[0067] The system layer includes system libraries and the Android Runtime. System libraries can include multiple functional modules, such as image rendering libraries, image compositing libraries, function libraries, media libraries, and key management modules. The key management module provides applications with necessary key management and encryption / decryption functions, such as generating, storing, and managing encryption keys to protect the security of application and user data.
[0068] The Android runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries comprise two parts: one part contains the functionalities that Java calls, and the other part consists of the Android core libraries. The application layer and application framework layer run in the virtual machine, which executes the Java files of the application layer and application framework layer into binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0069] Understandable, Figure 3 The components included in the system framework layer, system library, and runtime layer shown do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than shown, or combine some components, or split some components, or have different component arrangements.
[0070] The kernel layer is the layer between the hardware and the aforementioned software layers. The kernel layer contains at least display drivers, camera drivers, and sensor drivers. Hardware may include devices such as cameras, displays, microphones, processors, and memory.
[0071] The following is combined with Figure 4The flowchart shown illustrates the hybrid signature process. Figure 4 As shown, the hybrid signature process may include operations S101 to S103.
[0072] In operation S101, the electronic device takes the target message to be signed as the first input data of the first trusted execution environment, and uses the first trusted execution environment to perform a signing operation on the first input data based on traditional cryptographic algorithms to obtain the first digital signature.
[0073] In operation S102, the electronic device uses the target message and the first digital signature as the second input data of the second trusted execution environment, and uses the second trusted execution environment to perform a signature operation on the second input data based on the post-quantum cryptography algorithm to obtain the second digital signature.
[0074] In operation S103, the electronic device concatenates the first digital signature and the second digital signature to obtain a hybrid digital signature for the target message.
[0075] The following examples illustrate the operational flow of the hybrid signature process in this embodiment.
[0076] In operation S101, the electronic device takes the target message to be signed as the first input data of the first trusted execution environment, and uses the first trusted execution environment to perform a signing operation on the first input data based on traditional cryptographic algorithms to obtain the first digital signature.
[0077] For example, the target message to be signed can be generated by the electronic device or obtained by the electronic device from other electronic devices. In response to obtaining the target message to be signed, the electronic device uses the target message as first input data to the first trusted execution environment. The electronic device then sends the first input data to the first trusted execution environment and uses the first trusted execution environment to perform a signing operation on the first input data based on a conventional cryptographic algorithm.
[0078] Before performing a signature operation based on a traditional cryptographic algorithm on the first input data using the first trusted execution environment, the electronic device can also use the first trusted execution environment to generate a first signature key pair based on a traditional cryptographic algorithm, and use the second trusted execution environment to generate a second signature key pair based on a post-quantum cryptographic algorithm. The first signature key pair includes a first signing private key and a first verification public key, and the second signature key pair includes a second signing private key and a second verification public key.
[0079] The first trusted execution environment is equipped with traditional cryptographic algorithms to support key management in traditional cryptography. The second trusted execution environment is equipped with post-quantum cryptographic algorithms to support key management in post-quantum cryptography. This configuration ensures the system has strong protection capabilities in terms of current and future cryptographic security performance.
[0080] Traditional cryptographic algorithms include those other than post-quantum cryptography, such as symmetric encryption algorithms (e.g., AES) and asymmetric encryption algorithms (e.g., RSA). Post-quantum cryptography refers to cryptographic algorithms resistant to quantum computing attacks, such as lattice-based cryptographic algorithms (e.g., NTRUEncrypt) and hash function algorithms (e.g., SHA-3).
[0081] A Trusted Execution Environment (TEE) is a secure computing environment designed to provide a high level of protection for critical applications and important data. Typically implemented through a combination of hardware and software, a TEE provides an isolated execution environment, separate from the operating system and other applications, to protect code and data from malware or unauthorized access. TEE offers encrypted and secure computing capabilities, ensuring that sensitive data is protected during processing and transmission, effectively safeguarding data privacy and integrity.
[0082] For example, TrustZone technology is a hardware-level security solution designed to provide a secure, trusted execution environment to protect sensitive data and critical system resources from malicious attacks. TrustZone technology utilizes the processor's hardware isolation capabilities to divide the processor into a secure environment and a normal environment, serving as two distinct execution environments, each with its own independent space and system resources. In TrustZone technology, the secure environment can run trusted applications and security services, while the normal environment can run ordinary applications and the operating system. TrustZone technology ensures the security of sensitive data at the hardware level, preventing unauthorized access and malware attacks.
[0083] In one alternative implementation, the electronic device can sign the first input data using a first signing private key in a first trusted execution environment to obtain a first digital signature.
[0084] In operation S102, the electronic device uses the target message and the first digital signature as the second input data of the second trusted execution environment, and uses the second trusted execution environment to perform a signature operation on the second input data based on the post-quantum cryptography algorithm to obtain the second digital signature.
[0085] For example, the electronic device can concatenate the target message and the first digital signature to obtain an intermediate signature value, which is then used as the second input data for the second trusted execution environment. The electronic device then transmits the second input data to the second trusted execution environment and uses the second trusted execution environment to perform a signature operation based on a post-quantum cryptography algorithm on the second input data to obtain the second digital signature.
[0086] In one optional implementation, the electronic device can sign the intermediate signature value using a second signing private key within a second trusted execution environment to obtain a second digital signature. Specifically, the electronic device can perform a hash calculation on the intermediate signature value within the second trusted execution environment to obtain a message digest of a preset length, and then sign the message digest using the second signing private key to obtain the second digital signature.
[0087] In operation S103, the electronic device concatenates the first digital signature and the second digital signature to obtain a hybrid digital signature for the target message.
[0088] For example, the electronic device concatenates the first and second digital signatures to obtain a hybrid digital signature for the target message. The hybrid digital signature contains a first digital signature based on a traditional cryptographic algorithm and a second digital signature based on a post-quantum cryptographic algorithm. Because the first and second trusted execution environments are independent of each other, even if an attacker gains access to one of the trusted execution environments, they cannot forge or verify the hybrid digital signature, which significantly improves the security of message transmission.
[0089] In one alternative implementation, the electronic device can upload a first verification public key and a second verification public key to a key management platform, so that the message receiving electronic device can use the first and second verification public keys to verify the hybrid digital signature. The key management platform is a cloud service platform composed of a computer cluster.
[0090] The following is combined with Figure 5 The diagram shown illustrates the hybrid signature process. Figure 5 As shown, the hybrid signature process involves at least two trusted execution environments: QTEE and HTEE. QTEE is Qualcomm's TEE environment, which includes traditional signature cryptography algorithms and supports key management for traditional cryptography. HTEE is Honor's TEE environment, which includes post-quantum cryptography algorithms and supports key management for post-quantum cryptography.
[0091] The electronic device first generates key pairs in both the QTEE and HTEE. Specifically, the electronic device generates a key pair A based on traditional signatures separately in the QTEE, which includes a private key A and a public key A. The electronic device generates a key pair B based on post-quantum signatures separately in the HTEE, which includes a private key B and a public key B. Key pairs A and B are independent of each other.
[0092] When signing the target message, the electronic device first sends the target message to the QTEE, where it performs a traditional signature on the target message using private key A, obtaining signature value A. The electronic device then concatenates the target message and signature value A to obtain an intermediate message. The electronic device then sends the intermediate message to the HTEE, where it performs a post-quantum signature on the intermediate message using private key B, obtaining signature value B. Finally, the electronic device concatenates signature value A and signature value B to obtain the complete signature value, which serves as the hybrid signature value for the target message.
[0093] The following is combined with Figure 6 The flowchart shown illustrates the signature verification process for hybrid digital signatures. Figure 6 As shown, the signature verification process of hybrid digital signatures may include operations S201 to S205.
[0094] In operation S201, the electronic device, in response to the received signed target message, sends a key acquisition request to the key management platform. The key acquisition request carries the identification information of the message sender, and the signed target message has a hybrid digital signature.
[0095] In operation S202, the electronic device receives multiple verification public keys that match the identification information returned by the key management platform.
[0096] In operation S203, the electronic device parses the hybrid digital signature to obtain multiple digital signatures based on different cryptographic algorithms.
[0097] In operation S204, in multiple trusted execution environments, electronic devices use various verification public keys to verify corresponding digital signatures among multiple digital signatures.
[0098] In operation S205, if all digital signatures are verified, the electronic device will treat the target message as valid data.
[0099] The following examples illustrate the operation flow of the signature verification process in this embodiment.
[0100] In operation S201, the electronic device, in response to the received signed target message, sends a key acquisition request to the key management platform. The key acquisition request carries the identification information of the message sender, and the signed target message has a hybrid digital signature.
[0101] For example, after receiving a signed target message, an electronic device sends a key acquisition request carrying the message sender's identification information to a key management platform to obtain multiple verification public keys matching the identification information. The key management platform stores multiple verification public keys, each corresponding to a message sender. The verification public keys may include a first verification public key based on a traditional cryptographic algorithm and a second verification public key based on a post-quantum cryptographic algorithm. The verification public keys are pre-stored in the key management platform by the message sender.
[0102] For example, the verification public key may include a public key A based on a traditional cryptographic algorithm and a public key B based on a post-quantum cryptographic algorithm. Public key A may be generated by the message sender using a QTEE environment based on a traditional cryptographic algorithm. Public key B may be generated by the message sender using an HTEE environment based on a post-quantum cryptographic algorithm.
[0103] The signed target message has a hybrid digital signature. The hybrid digital signature is obtained by concatenating a first digital signature and a second digital signature. The first digital signature is obtained by the message sender using a traditional cryptographic algorithm, and the second digital signature is obtained by the message sender using a post-quantum cryptographic algorithm.
[0104] For example, the first digital signature can be obtained by the message sender using private key A. The second digital signature can be obtained by the message sender using private key B. Private key A can be generated by the message sender using a QTEE environment based on a traditional cryptographic algorithm. Private key B can be generated by the message sender using an HTEE environment based on a post-quantum cryptographic algorithm.
[0105] In operation S202, the electronic device receives multiple verification public keys that match the identification information returned by the key management platform.
[0106] For example, a key management platform receives a key acquisition request sent by an electronic device and returns multiple verification public keys to the electronic device that match the identifier information of the message sender. The electronic device receives the multiple verification public keys returned by the key management platform.
[0107] In one alternative implementation, the electronic device receives a first verification public key based on a traditional cryptographic algorithm and a second verification public key based on a post-quantum cryptographic algorithm, returned by a key management platform.
[0108] In operation S203, the electronic device parses the hybrid digital signature to obtain multiple digital signatures based on different cryptographic algorithms.
[0109] For example, the electronic device first splits the signed target message to obtain the target message and a hybrid digital signature, and then splits the hybrid digital signature to obtain multiple digital signatures based on different cryptographic algorithms. Specifically, the electronic device parses the hybrid digital signature to obtain a first digital signature based on a traditional cryptographic algorithm and a second digital signature based on a post-quantum cryptographic algorithm. The traditional cryptographic algorithm includes cryptographic algorithms other than the post-quantum cryptographic algorithm.
[0110] In operation S204, in multiple trusted execution environments, electronic devices use various verification public keys to verify corresponding digital signatures among multiple digital signatures.
[0111] For example, the electronic device inputs each verification public key and the corresponding digital signature into the corresponding trusted execution environment, and uses the corresponding verification public key to verify the corresponding digital signature.
[0112] Specifically, the electronic device uses the target message, the first digital signature, and the first verification public key as the third input data to the first trusted execution environment, and performs signature verification based on the third input data using the first trusted execution environment to obtain a first verification result. The electronic device uses the target message, the first digital signature, the second digital signature, and the second verification public key as the fourth input data to the second trusted execution environment, and performs signature verification based on the fourth input data using the second trusted execution environment to obtain a second verification result.
[0113] For example, the electronic device sends the target message, the first digital signature (signature value A), and the public key A to a QTEE environment for signature verification. The electronic device also sends the target message, the first digital signature (signature value A), the second digital signature (signature value B), and the public key B to an HTEE environment for signature verification.
[0114] In operation S205, if all digital signatures are verified, the electronic device will treat the target message as valid data.
[0115] For example, if both the first and second verification results indicate that the verification has passed, the target message is considered valid data. For instance, signature verification is confirmed as successful only if both the QTEE and HTEE environments report successful signature verification; otherwise, signature verification is considered unsuccessful.
[0116] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0117] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0118] This embodiment also provides an electronic device, including: one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory. When the computer programs are executed by the one or more processors, the electronic device performs the following steps: taking a target message to be signed as first input data to a first trusted execution environment; using the first trusted execution environment to perform a signature operation on the first input data based on a traditional cryptographic algorithm to obtain a first digital signature; taking the target message and the first digital signature as second input data to a second trusted execution environment; using the second trusted execution environment to perform a signature operation on the second input data based on a post-quantum cryptographic algorithm to obtain a second digital signature; and concatenating the first digital signature and the second digital signature to obtain a hybrid digital signature for the target message.
[0119] This embodiment also provides another electronic device, including: one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: In response to a received signed target message, sending a key acquisition request to a key management platform, wherein the key acquisition request carries identification information of the message sender, and the signed target message has a hybrid digital signature; receiving multiple verification public keys returned by the key management platform that match the identification information; parsing the hybrid digital signature to obtain multiple digital signatures based on different cryptographic algorithms; verifying the corresponding digital signatures among the multiple digital signatures using each verification public key in multiple trusted execution environments; and, if all digital signatures pass verification, treating the target message as valid data.
[0120] This embodiment also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the above-described related method steps to implement the hybrid signature method or signature verification method in the above embodiment.
[0121] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement the hybrid signature method or signature verification method in the above embodiments.
[0122] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory. The memory is used to store computer execution instructions. When the apparatus is running, the processor can execute the computer execution instructions stored in the memory to cause the chip to execute the hybrid signature method or signature verification method in the above method embodiments.
[0123] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0124] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0126] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0127] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0128] Any content in the various embodiments of this application, as well as any content in the same embodiment, can be freely combined. Any combination of the above content is within the scope of this application.
[0129] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0130] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0131] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium well known in the art. One exemplary embodiment couples a storage medium to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.
[0132] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0133] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A hybrid signature method, characterized in that, Applied to electronic devices, the method includes: The target message to be signed is used as the first input data of the first trusted execution environment. The first trusted execution environment is used to perform a signing operation on the first input data based on traditional cryptographic algorithms to obtain the first digital signature. Using the target message and the first digital signature as the second input data of the second trusted execution environment, and utilizing the second trusted execution environment, performing a signature operation based on a post-quantum cryptography algorithm on the second input data to obtain the second digital signature; and The first digital signature and the second digital signature are concatenated to obtain a hybrid digital signature for the target message.
2. The method according to claim 1, characterized in that, The method further includes: Using the first trusted execution environment, a first signature key pair based on the traditional cryptographic algorithm is generated, the first signature key pair including a first signing private key and a first verification public key; and Using the second trusted execution environment, a second signature key pair based on the post-quantum cryptography algorithm is generated. The second signature key pair includes a second signature private key and a second verification public key. The conventional cryptographic algorithms include cryptographic algorithms other than the post-quantum cryptographic algorithm.
3. The method according to claim 2, characterized in that, The step of using the first trusted execution environment to perform a signature operation on the first input data based on a traditional cryptographic algorithm to obtain a first digital signature includes: In the first trusted execution environment, the first input data is signed using the first signing private key to obtain the first digital signature; and The step of using the target message and the first digital signature as second input data for a second trusted execution environment, and then using the second trusted execution environment to perform a signature operation based on a post-quantum cryptography algorithm on the second input data to obtain a second digital signature, includes: The target message and the first digital signature are concatenated to obtain an intermediate signature value, which is used as the second input data. In the second trusted execution environment, the intermediate signature value is signed using the second signing private key to obtain the second digital signature.
4. The method according to claim 3, characterized in that, In the second trusted execution environment, the intermediate signature value is signed using the second signing private key to obtain the second digital signature, including: In the second trusted execution environment, the intermediate signature value is hashed to obtain a message digest of a preset length; and The message digest is signed using the second signing private key to obtain the second digital signature.
5. The method according to claim 2, characterized in that, The method further includes: The first verification public key and the second verification public key are uploaded to the key management platform, which is a cloud service platform composed of a computer cluster.
6. A signature verification method, characterized in that, Applied to electronic devices, the method includes: In response to a received signed target message, a key acquisition request is sent to a key management platform, wherein the key acquisition request carries the identifier information of the message sender, and the signed target message has a hybrid digital signature; wherein the hybrid digital signature is obtained based on the hybrid signature method according to any one of claims 1 to 5; Receive multiple verification public keys that match the identification information returned by the key management platform; The hybrid digital signature is parsed to obtain multiple digital signatures based on different cryptographic algorithms; In multiple trusted execution environments, the corresponding digital signatures among the multiple digital signatures are verified using the respective verification public keys; and If all the digital signatures are verified, the target message is considered valid data.
7. The method according to claim 6, characterized in that, The step of receiving multiple verification public keys that match the identification information returned by the key management platform includes: Receive a first verification public key based on a traditional cryptographic algorithm and a second verification public key based on a post-quantum cryptographic algorithm returned by the key management platform; and The process of parsing the hybrid digital signature yields multiple digital signatures based on different cryptographic algorithms, including: Parsing the hybrid digital signature yields a first digital signature based on the traditional cryptographic algorithm and a second digital signature based on the post-quantum cryptographic algorithm. The conventional cryptographic algorithms include cryptographic algorithms other than the post-quantum cryptographic algorithm.
8. The method according to claim 7, characterized in that, The step of verifying the corresponding digital signature among the multiple digital signatures using the verification public keys in multiple trusted execution environments includes: Using the target message, the first digital signature, and the first verification public key as third input data to the first trusted execution environment, and performing signature verification based on the third input data using the first trusted execution environment, a first verification result is obtained; and The target message, the first digital signature, the second digital signature, and the second verification public key are used as the fourth input data of the second trusted execution environment. The second trusted execution environment is used to perform signature verification based on the fourth input data to obtain a second verification result.
9. The method according to claim 8, characterized in that, The step of treating the target message as valid data when all the digital signatures have been verified includes: If both the first verification result and the second verification result indicate that the verification is successful, the target message is considered as valid data.
10. An electronic device, characterized in that, include: One or more processors, memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, cause the electronic device to perform the following steps: The target message to be signed is used as the first input data of the first trusted execution environment. The first trusted execution environment is used to perform a signing operation on the first input data based on traditional cryptographic algorithms to obtain the first digital signature. The target message and the first digital signature are used as the second input data of the second trusted execution environment. The second trusted execution environment is used to perform a signature operation based on the post-quantum cryptography algorithm on the second input data to obtain the second digital signature. as well as The first digital signature and the second digital signature are concatenated to obtain a hybrid digital signature for the target message.
11. An electronic device, characterized in that, include: One or more processors, memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, cause the electronic device to perform the following steps: In response to a received signed target message, a key acquisition request is sent to a key management platform, wherein the key acquisition request carries the identifier information of the message sender, and the signed target message has a hybrid digital signature; wherein the hybrid digital signature is obtained based on the hybrid signature method according to any one of claims 1 to 5; Receive multiple verification public keys that match the identification information returned by the key management platform; The hybrid digital signature is parsed to obtain multiple digital signatures based on different cryptographic algorithms; In multiple trusted execution environments, the corresponding digital signatures among the multiple digital signatures are verified using the respective verification public keys; and If all the digital signatures are verified, the target message is considered valid data.
12. A computer-readable storage medium, characterized in that, The method includes a computer program that, when run on an electronic device, causes the electronic device to perform the hybrid signature method as described in any one of claims 1 to 5, or the signature verification method as described in any one of claims 6 to 9.