Message verification method and system capable of being verified by third party
By generating a constrained key that constrains the pseudo-random function, and using the Hash-then-CPRF structure and the SHA3 algorithm, the problem in the existing technology that a third party cannot verify the integrity of the message and forge the legal MAC value is solved, and the security verification of the message is achieved. and integrity checks.
Patent Information
- Application Number
- CN202411212343.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing message authentication code technology, the third party cannot verify the integrity of the message and cannot prevent the forgery of legal MAC values, leading to the risk of message tampering and disguise attacks.
By obtaining the initial key and message set from the key space and message space, a constrained key is generated that constrains the pseudo-random function, allowing a third party to verify the integrity of the message, and utilizing the Hash-then-CPRF structure design to generate 256 using the SHA3 algorithm Bit digest data ensures that third parties cannot forge legitimate MAC values.
It allows designated third parties to verify the integrity of a small number of designated messages, prevents third parties from forging legal MAC values, and ensures the integrity and security of messages.
Smart Images

Figure CN118740520A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of cryptography, and in particular relates to a message verification method and system that can be verified by a third party. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Message Authentication Code (MAC) is an important security technology used to ensure the integrity and identity of messages. It uses the key K shared between the sender and receiver of the message to map a message of any length into data of a fixed length, which is called a MAC value. The receiver uses the shared key K and the received message to verify the correctness of the MAC value, thereby checking whether the content has been changed during the message transmission process and confirming the source of the message.
[0004] At present, there have been a lot of research on the implementation of message authentication codes. People's expectations for MAC are no longer limited to provably secure, but also hope that it has advantages such as fast computing speed and support for parallel computing. Common MAC construction methods include: one-way hash function implementation method and block cipher implementation method, such as: HMAC, CBC-MAC, PMAC and Wegman-Carter MACs.
[0005] However, in a message authentication code, the shared key between the sender and the receiver cannot usually be obtained by a third party. Once a third party obtains the shared key, it can forge other legitimate MAC values and freely perform tampering and spoofing attacks, so it is impossible to allow a third party to verify the integrity of the message. The function of a third party verifying the integrity of a message can usually be implemented using a digital signature scheme in public key cryptography, but if only a designated third party is allowed to verify the integrity of a small number of designated messages, then digital signatures can do nothing. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes a message verification method and system that can be verified by a third party. The present invention allows a third party holding a constrained key of a constrained pseudo-random function to verify the integrity of a small number of specified messages, and the third party cannot forge other legal MAC values. According to some embodiments, the present invention adopts the following technical solutions: A first aspect of the present invention provides a message verification method that can be verified by a third party, comprising the following steps: Get the initial key from the key space and message space And the message collection that you want the third-party agent to verify ; Using the initial key and message collection , generate the corresponding constrained pseudo-random function constraint key ; Constrained key based , any message and authentication code , verification message integrity.
[0007] As an optional implementation, generate a constraint key of a corresponding constrained pseudo-random function The process includes: Message Collection Each message in Use the Hash function to generate the corresponding summary data , forming a collection of summaries ,in, , the initial key and summary collection As a constrained pseudorandom function The input of the algorithm generates a constrained pseudo-random function in the set The constraint key under ,in, , using it as a message authentication code in the message set The constraint key under .
[0008] As an alternative implementation, the verification message The integrity process includes: Use the Hash function to get the corresponding summary data ,in, , constrain the key and summary data d as a constrained pseudorandom function The input of the algorithm calculates the corresponding pseudo-random function value as the correct message authentication code of the message 𝑚 ,in ; If the calculated message authentication code With the given message authentication code The same, then the message is complete and has not been tampered with; if the calculated message authentication code With the given message authentication code If different, the message May be tampered with.
[0009] As a further implementation, the generation process of a given message authentication code includes: Based on a given initial key and Message , apply the Hash function to it to get the corresponding summary data ,in, , the initial key and summary data As a constrained pseudorandom function The input of the algorithm calculates the corresponding pseudo-random function value as the message Message Authentication Code ,in, .
[0010] As a further implementation, the method is designed based on a Hash-then-CPRF structure, wherein Hash is a one-way hash function and CPRF is a constrained pseudo-random function.
[0011] As a further implementation, the Hash function uses a SHA3 algorithm, and the length of the summary data obtained by using the Hash function is 256 bits.
[0012] A second aspect of the present invention provides a message verification system that can be verified by a third party, comprising: The acquisition module is used to obtain the initial key from the key space and message space And the message collection that you want the third-party agent to verify ; Constrained key generation module for utilizing initial keys and message collection , generate the corresponding constrained pseudo-random function constraint key ; Third-party message authentication module for constrained keys , any message and authentication code , verification message integrity.
[0013] The third aspect of the present invention provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of a message verification method that can be verified by a third party are performed.
[0014] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, executes the steps of a message verification method that can be verified by a third party.
[0015] A fifth aspect of the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it performs the steps of a message verification method that can be verified by a third party.
[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention obtains the initial key and the message set that the third party agent wants to verify from the key space and the message space; uses the initial key and the message set to generate the corresponding constraint key of the constrained pseudo-random function; uses the constraint key, any message belonging to the message set and a given authentication code to verify the integrity of the message. In this way, the function of allowing a designated third party to verify the integrity of a small number of designated messages is realized under the premise that the third party cannot forge other legal MAC values.
[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0019] Figure 1 1 is a flow chart of a message verification method that can be verified by a third party provided in Embodiment 1 of the present invention; Figure 2 It is a schematic diagram of a proxy verification process in a message verification method that can be verified by a third party provided in the first embodiment of the present invention; Figure 3 It is a schematic diagram of the process of generating a message authentication code provided in the first embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0021] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0022] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0023] In the absence of conflict, the embodiments in this application and the features in the embodiments may be combined with each other.
[0024] Embodiment 1 like Figure 1 As shown, this embodiment discloses a message verification method that can be verified by a third party, including: Obtain an initial key and a message set that the third-party agent wants to verify from the key space and the message space; Generate a corresponding constrained pseudo-random function's constrained key using the initial key and the message set; Using the constraint key, any message belonging to the message set and a given authentication code, the integrity of the message can be verified by a third party.
[0025] In this embodiment, the message verification step that can be verified by a third party is as follows: Figure 2 As shown, including: Get the initial key from the key space and message space And the message collection that you want the third-party agent to verify ; Using the initial key and message collection , generate the corresponding constrained pseudo-random function constraint key ; Specifically, Figure 2 As shown, the process of generating the constraint key of the constrained pseudo-random function is: Message Collection Each message in Use the hash function to generate the corresponding 256-bit summary data , forming a collection of summaries ,in, , , the initial key and summary collection As a constrained pseudorandom function The input of the algorithm generates a constrained pseudo-random function in the set The constraint key under ,in, , using it as a message authentication code in the message set The constraint key under .
[0026] Given a constraint key , any message and authentication code , third party verifiable message integrity; Specifically, Figure 2 As shown, the verification process is: right Use the Hash function to get the corresponding 256-bit summary data ,in, , constrain the key and summary data d as a constrained pseudorandom function The input of the algorithm calculates the corresponding pseudo-random function value as the "correct" message authentication code of the message 𝑚 ,in .
[0027] If the calculated message authentication code With the given message authentication code The same, that is , then the message is complete and has not been tampered with; if the calculated message authentication code With the given message authentication code Different, that is , then the message May be tampered with.
[0028] like Figure 3 As shown, the steps of generating a message authentication code (generally performed by the sender and the receiver) in this embodiment are as follows: Given an initial key and Message , apply the Hash function to it and get the corresponding 256-bit summary data ,in, , the initial key and summary data As a constrained pseudorandom function The input of the algorithm calculates the corresponding pseudo-random function value as the message Message Authentication Code ,in, .
[0029] Since SHA3 is computationally collision-resistant, it is impossible to calculate such a ,but , so that the constrained key of the constrained pseudorandom function can be used ,calculate , that is, a third party cannot use the constraint key Forge a legitimate MAC value of a message that is not in the specified message set, and the third party does not obtain the initial key , so third parties cannot use The algorithm calculates other legal MAC values. In this way, it ensures that a third party cannot forge other legal MAC values, and implements the function of allowing a designated third party to verify the integrity of a small number of specified messages.
[0030] In this embodiment, the message verification method of the third-party verification is based on the Hash-then-CPRF structure design, wherein Hash is a one-way hash function and CPRF is a constrained pseudo-random function.
[0031] The hash function uses the SHA3 algorithm, and the digest data length obtained by using the hash function is 256 bits. CPRF can use any constrained pseudo-random function.
[0032] Embodiment 2 The purpose of this embodiment is to provide a message verification system that can be verified by a third party, including: An acquisition module is used to acquire an initial key and a message set that is desired to be verified by a third-party agent from a key space and a message space; A constrained key generation module, used to generate a constrained key of a corresponding constrained pseudo-random function using an initial key and a message set; The third-party message verification module is used to verify the integrity of a message by using a constraint key, any message belonging to a message set and a given authentication code.
[0033] Embodiment 3 The purpose of this embodiment is to provide a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the method provided in Embodiment 1 are performed.
[0034] Embodiment 4 The purpose of this embodiment is to provide a computer-readable storage medium.
[0035] A computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the method provided in embodiment 1.
[0036] Embodiment 5 A computer program product includes a computer program. When the computer program is executed by a processor, the computer program performs the steps of a message verification method that can be verified by a third party provided in embodiment 1.
[0037] The steps involved in the apparatuses of the above embodiments 2, 3, 4 and 5 correspond to the method embodiment 1, and the specific implementation methods can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method of the present invention.
[0038] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0039] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of an all-hardware embodiment, an all-software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of one or more computer-usable storage media (including but not limited to disk storage, CD - ROM , optical storage, etc.).
[0040] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0041] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0042] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0043] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principle of the present invention without creative labor shall be included in the protection scope of the present invention.
Claims
1. A message verification method that can be verified by a third party, characterized in that: The following steps are involved: Get the initial key from the key space and message space And the message collection that you want the third-party agent to verify ; Using the initial key and message collection , generate the corresponding constrained pseudo-random function constraint key ; Constrained key based , any message and authentication code , verification message integrity.
2. A message verification method that can be verified by a third party as claimed in claim 1, characterized in that: Generates the corresponding constrained pseudorandom function's constraint key The process includes: Message Collection Each message in Use the Hash function to generate the corresponding summary data , forming a collection of summaries ,in, , the initial key and summary collection As a constrained pseudorandom function The input of the algorithm generates a constrained pseudo-random function in the set The constraint key under ,in, , using it as a message authentication code in the message set The constraint key under .
3. A message verification method that can be verified by a third party as claimed in claim 1, characterized in that: Verification Message The integrity process includes: Use the Hash function to get the corresponding summary data ,in, , constrain the key and summary data d as a constrained pseudorandom function The input of the algorithm calculates the corresponding pseudo-random function value as the correct message authentication code of the message 𝑚 ,in ; If the calculated message authentication code With the given message authentication code The same, then the message is complete and has not been tampered with; if the calculated message authentication code With the given message authentication code If different, the message May be tampered with.
4. A message verification method that can be verified by a third party as claimed in claim 3, characterized in that: The generation process of a given message authentication code includes: Based on a given initial key and Message , apply the Hash function to it to get the corresponding summary data ,in, , the initial key and summary data As a constrained pseudorandom function The input of the algorithm calculates the corresponding pseudo-random function value as the message Message Authentication Code ,in, .
5. A message verification method that can be verified by a third party as claimed in claim 3 or 4, characterized in that: The method is designed based on a Hash-then-CPRF structure, wherein Hash is a one-way hash function and CPRF is a constrained pseudo-random function.
6. A message verification method that can be verified by a third party as claimed in claim 3 or 4, characterized in that: The Hash function uses the SHA3 algorithm, and the length of the summary data obtained by using the Hash function is 256 bits.
7. A message verification system that can be verified by a third party, characterized in that: include: The acquisition module is used to obtain the initial key from the key space and message space And the message collection that you want the third-party agent to verify ; Constrained key generation module for utilizing initial keys and message collection , generate the corresponding constrained pseudo-random function constraint key ; Third-party message authentication module for constrained keys , any message and authentication code , verification message integrity.
8. A computer device, comprising: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of a message verification method that can be verified by a third party as described in any of claims 1-6 are performed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a message verification method that can be verified by a third party as described in any one of claims 1 to 6 are executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program performs the steps of a message verification method verifiable by a third party as described in any one of claims 1 to 6.
