A message authentication method and system
By introducing an authentication chain into the IP message for source authentication, the problem of insufficient anti-network attack capability during transmission of IP messages is solved, improving security and reducing computing resource requirements.
Patent Information
- Application Number
- CN202211447796.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-11-18
AI Technical Summary
The existing IP packets have poor anti-network attack capabilities during transmission and are vulnerable to forged packet attacks.
The authentication chain is used as the option data for the IPv6 authentication extension header. The authentication code is generated by calculating the signature value and certificate serial number, and the signature verification is carried out on each secure router and receiving terminal to ensure the legality of the packet.
It improves the transmission security of IP packets, reduces the computing resource requirements for key negotiation, and enhances the ability to resist network attacks.
Smart Images

Figure CN115766237B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer IP network applications, and more specifically, relates to a message authentication method and system. Background Art
[0002] To improve network reliability, network communication devices forward IP packets by enabling the same packet to be transmitted from sender to receiver along multiple different paths. They also support secure forwarding along designated paths. However, by intercepting legitimate packets, network terminals can impersonate legitimate senders and forge packets, sending them to receivers to launch network attacks. Summary of the Invention
[0003] In view of the defects of the prior art, the purpose of the present invention is to provide a message authentication method and system, aiming to solve the problem that the existing IP message has poor resistance to network attacks during transmission.
[0004] To achieve the above object, the present invention provides a message authentication method, comprising the following steps:
[0005] S1: Use an authentication chain as optional data in the IPv6 authentication extension header; the authentication chain includes a one-byte authentication code number, a one-byte single authentication code length, a four-byte timestamp, and multiple authentication codes; the length of each authentication code is an integer multiple of eight bytes; the authentication code includes a four-byte certificate serial number and an N-4-byte authentication value; the authentication value includes a signature value and padding data; where N is an integer greater than 4;
[0006] S2: Calculate the signature value by calculating the hash value of the IPv6 message to be sent by the sending terminal, and then generate the initial authentication code by combining the signature value, the certificate serial number of the sending terminal and the padding data. The initial authentication code is added to the end of the authentication chain and the IPv6 message is sent.
[0007] S3: parse the authentication chain of the IPv6 message received by the receiving device, extract the certificate serial number in each authentication code, and find the certificate corresponding to each authentication code to obtain the public key;
[0008] S4: Calculate the signature value in the nth authentication code by calculating the hash value before the nth authentication code in the received IPv6 message, and input the public key, signature value and hash value corresponding to each authentication code into the signature verification algorithm for verification;
[0009] S5: If all authentication codes pass the signature verification and the receiving device is an intermediate receiving end, the signature value is calculated based on the private key of the intermediate receiving end and the hash value of the IPv6 message before the mth authentication code. The certificate serial number of the intermediate receiving end and the signature value are used to generate the m+1th authentication code, which is added to the end of the authentication chain. The IPv6 message is updated and the process goes to S3. If all authentication codes pass the signature verification and the receiving device is the final receiving end, the IPv6 message is sent to the application. Where n≤m; m is the total number of authentication codes.
[0010] Further preferably, the hash value calculation method before the nth authentication code in the IPv6 message is:
[0011] Concatenate the IP payload, source address, destination address, protocol, and all bytes before the nth authentication code in the extension header into a continuous byte string;
[0012] Calculate the hash value of a byte string;
[0013] The signature value is calculated using the hash value, where the signature value is ECCSign(hash); hash is the hash value of the message.
[0014] Further preferably, the intermediate receiving end is each security router on the message transmission path.
[0015] In another aspect, the present invention provides a message authentication system, comprising:
[0016] An authentication chain construction module, configured to use an authentication chain as optional data of an IPv6 authentication extension header; wherein the authentication chain includes a one-byte number of authentication codes, a one-byte length of a single authentication code, a four-byte timestamp, and multiple authentication codes; the length of each authentication code is an integer multiple of eight bytes; the authentication code includes a four-byte certificate serial number and an N-4-byte authentication value; the authentication value includes a signature value and padding data; wherein N is an integer greater than 4;
[0017] The sending terminal is used to calculate the signature value by calculating the hash value of the sent IPv6 message, and then generate the initial authentication code by combining the signature value, the certificate serial number of the sending terminal and the padding data. The initial authentication code is added to the end of the authentication chain before sending the message;
[0018] The receiving device is used to parse the authentication chain of the received IPv6 message, extract the certificate serial number in each authentication code, and search the certificate corresponding to each authentication code to obtain the public key; calculate the signature value in the nth authentication code by calculating the hash value before the nth authentication code in the received IPv6 message, and input the public key, signature value and hash value corresponding to each authentication code into the signature verification algorithm for verification; if all authentication codes pass the signature verification and the receiving device is an intermediate receiving end, calculate the signature value according to the private key of the intermediate receiving end and the hash value of the IPv6 message before the mth authentication code, use the certificate serial number and signature value of the intermediate receiving end to generate the m+1th authentication code, and add it to the end of the authentication chain; if all authentication codes pass the signature verification and the receiving device is the final receiving end, send the IPv6 message to the application; where n≤m; m is the total number of authentication codes.
[0019] Further preferably, the hash value calculation method before the nth authentication code in the IPv6 message is:
[0020] Concatenate the IP payload, source address, destination address, protocol, and all bytes before the nth authentication code in the extension header into a continuous byte string;
[0021] Calculate the hash value of a byte string;
[0022] The signature value is calculated using the hash value, where the signature value is ECCSign(hash); hash is the hash value of the message.
[0023] Further preferably, the intermediate receiving end is each security router on the message transmission path.
[0024] In general, the above technical solutions conceived by the present invention have the following advantages compared with the prior art:
[0025] Beneficial effects:
[0026] The present invention provides a message authentication method and system. This method uses an authentication chain as optional data in the IPv6 authentication extension header, occupying a portion of the IP message space. All sending and forwarding devices sequentially add authentication codes, enabling each secure router and receiving terminal along the way to trace the message's path to its source through the authentication chain in the message, thereby performing source authentication on the message's sender. The receiving terminal can verify the legitimacy of the message, improving resistance to network attacks and significantly enhancing the transmission security of IP messages.
[0027] The message authentication method and system provided by the present invention generates an intermediate authentication code based on the private key of the security router, and does not require key negotiation, thereby reducing the large amount of computing resources required for key negotiation between the three devices of message generation, transmission and reception, and ensuring the authenticity and non-repudiation of the authentication code. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a diagram of the IPv6 extension header structure provided by an embodiment of the present invention;
[0029] Figure 2 This is a diagram of the authentication chain structure provided by an embodiment of the present invention;
[0030] Figure 3 This is a diagram of the authentication code structure provided by an embodiment of the present invention;
[0031] Figure 4 This is a flow chart of establishing and verifying an authentication chain provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0033] In one aspect, the present invention provides a message authentication method, comprising the following steps:
[0034] S1: Select the authentication value calculation method, design the IPv6 extension header structure, authentication code structure and authentication chain structure;
[0035] like Figure 1 As shown in the figure, the authentication chain replaces the data format defined in RFC (Request For Comments) as the option data of the IPv6 authentication extension header.
[0036] like Figure 2 As shown, the authentication chain includes a one-byte authentication code number, a one-byte single authentication code length, a four-byte timestamp, and multiple authentication codes. The length of each authentication code is specified by a one-byte single authentication code length field, which is an integer multiple of 8 bytes. This ensures that after each authentication code is added, the length of the extension header is an integer multiple of 8 bytes, meeting the RFC requirements for the extension header length.
[0037] like Figure 3 As shown, the authentication code includes a four-byte certificate serial number and an N-4-byte authentication value. The certificate serial number is generated by the certificate server that issues the certificate in the system. The length of the authentication value includes the signature value and padding data. The signature value is determined by the key length of the ECC algorithm selected by the system. The length of the padding data must be set to ensure that the sum of the lengths of the certificate serial number, signature value, and padding data is an integer multiple of eight bytes.
[0038] S2: Calculate the authentication value for the sent IP message, construct the authentication code, and append it to the authentication chain;
[0039] The terminal device sending the message calculates the hash value of the IPv6 message = hash(IP payload || source address || destination address || protocol || content before the current authentication code in the extension header), then calculates the signature value = ECCSign(hash), fills the signature value and the device certificate serial number into the authentication code, and adds appropriate padding data to ensure that the sum of the length of the certificate serial number, signature value, and padding data is an integer multiple of eight bytes;
[0040] S3: Calculate the authentication value for the received IP message and compare it with the authentication codes contained in the message authentication chain in sequence until one authentication code fails to be compared or all authentication codes are successfully compared. More specifically, the following steps are included:
[0041] S3.1: parse the authentication chain of the IPv6 message received by the receiving device, extract the certificate serial number in each authentication code, and search the certificate corresponding to each authentication code to obtain the public key;
[0042] S3.2: Calculate the signature value of the nth authentication code by calculating the hash value before the nth authentication code in the received IPv6 message. Input the public key, signature value, and hash value corresponding to each authentication code into the signature verification algorithm for verification.
[0043] S3.3: If all authentication codes pass the signature verification and the receiving device is an intermediate receiving end, the signature value is calculated based on the private key of the intermediate receiving end and the hash value of the IPv6 message before the mth authentication code. The certificate serial number of the intermediate receiving end and the signature value are used to generate the m+1th authentication code, which is added to the end of the authentication chain. The IPv6 message is updated and the process goes to S3.1. If all authentication codes pass the signature verification and the receiving device is the final receiving end, the IPv6 message is sent to the application. Where n≤m; m is the total number of authentication codes.
[0044] On the other hand, Figure 4 The present invention provides a message authentication system, comprising:
[0045] An authentication chain construction module, configured to use an authentication chain as optional data of an IPv6 authentication extension header; wherein the authentication chain includes a one-byte number of authentication codes, a one-byte length of a single authentication code, a four-byte timestamp, and multiple authentication codes; the length of each authentication code is an integer multiple of eight bytes; the authentication code includes a four-byte certificate sequence and an N-4-byte authentication value; the authentication value includes a signature value and padding data; wherein N is an integer greater than 4;
[0046] The sending terminal is used to calculate the signature value by calculating the hash value of the sent IPv6 message, and then generate the initial authentication code by combining the signature value, the certificate serial number of the sending terminal and the padding data. The initial authentication code is added to the end of the authentication chain before sending the message;
[0047] The receiving device is used to parse the authentication chain of the received IPv6 message, extract the certificate serial number in each authentication code, and search the certificate corresponding to each authentication code to obtain the public key; calculate the signature value in the nth authentication code by calculating the hash value before the nth authentication code in the received IPv6 message, and input the public key, signature value and hash value corresponding to each authentication code into the signature verification algorithm for verification; if all authentication codes pass the signature verification and the receiving device is an intermediate receiving end, calculate the signature value according to the private key of the intermediate receiving end and the hash value of the IPv6 message before the mth authentication code, use the certificate serial number and signature value of the intermediate receiving end to generate the m+1th authentication code, and add it to the end of the authentication chain; if all authentication codes pass the signature verification and the receiving device is the final receiving end, send the IPv6 message to the application; where n≤m; m is the total number of authentication codes.
[0048] Further preferably, the hash value calculation method before the nth authentication code in the IPv6 message is:
[0049] Concatenate the IP payload, source address, destination address, protocol, and all bytes before the nth authentication code in the extension header into a continuous byte string;
[0050] Calculate the hash value of a byte string;
[0051] The signature value is calculated using the hash value, where the signature value is ECCSign(hash); hash is the hash value of the message.
[0052] Further preferably, the intermediate receiving end is each security router on the message transmission path.
[0053] The present invention provides a message authentication method and system. This method uses an authentication chain as optional data in the IPv6 authentication extension header, occupying a portion of the IP message space. All sending and forwarding devices sequentially add authentication codes, enabling each secure router and receiving terminal along the way to trace the message's path to its source through the authentication chain in the message, thereby performing source authentication on the message's sender. The receiving terminal can verify the legitimacy of the message, improving resistance to network attacks and significantly enhancing the transmission security of IP messages.
[0054] The message authentication method and system provided by the present invention generates an intermediate authentication code based on the private key of the security router, and does not require key negotiation, thereby reducing the large amount of computing resources required for key negotiation between the three devices of message generation, transmission and reception, and ensuring the authenticity and non-repudiation of the authentication code.
[0055] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A message authentication method, characterized in that: The following steps are involved: S1: Use an authentication chain as optional data in the IPv6 authentication extension header; the authentication chain includes a one-byte authentication code number, a one-byte single authentication code length, a four-byte timestamp, and multiple authentication codes; the length of each authentication code is an integer multiple of eight bytes; the authentication code includes a four-byte certificate serial number and an N-4-byte authentication value; the authentication value includes a signature value and padding data; where N is an integer greater than 4; S2: Calculate the signature value by calculating the hash value of the IPv6 message to be sent by the sending terminal, and then generate the initial authentication code by combining the signature value, the certificate serial number of the sending terminal and the padding data. The initial authentication code is added to the end of the authentication chain and the IPv6 message is sent. S3: parse the authentication chain of the IPv6 message received by the receiving device, extract the certificate serial number in each authentication code, and find the certificate corresponding to each authentication code to obtain the public key; S4: Calculate the signature value in the nth authentication code by calculating the hash value before the nth authentication code in the received IPv6 message, and input the public key, signature value and hash value corresponding to each authentication code into the signature verification algorithm for verification; S5: If all authentication codes pass the signature verification and the receiving device is an intermediate receiving end, the signature value is calculated based on the private key of the intermediate receiving end and the hash value of the IPv6 message before the mth authentication code. The certificate serial number of the intermediate receiving end and the signature value are used to generate the m+1th authentication code, which is added to the end of the authentication chain. The IPv6 message is updated and the process goes to S3. If all authentication codes pass the signature verification and the receiving device is the final receiving end, the IPv6 message is sent to the application. Where n≤m; m is the total number of authentication codes.
2. The message authentication method according to claim 1, characterized in that: The hash value before the nth authentication code in an IPv6 message is calculated as follows: Concatenate the IP payload, source address, destination address, protocol, and all bytes before the nth authentication code in the extension header into a continuous byte string; Calculate the hash value of a byte string; The signature value is calculated using the hash value, where the signature value is ECCSign(hash); hash is the hash value of the message.
3. The message authentication method according to claim 2, wherein: The intermediate receiving end is each security router on the message transmission path.
4. A message authentication system, characterized in that: include: An authentication chain construction module, configured to use an authentication chain as optional data of an IPv6 authentication extension header; wherein the authentication chain includes a one-byte number of authentication codes, a one-byte length of a single authentication code, a four-byte timestamp, and multiple authentication codes; the length of each authentication code is an integer multiple of eight bytes; the authentication code includes a four-byte certificate sequence and an N-4-byte authentication value; the authentication value includes a signature value and padding data; wherein N is an integer greater than 4; The sending terminal is used to calculate the signature value by calculating the hash value of the sent IPv6 message, and then generate the initial authentication code by combining the signature value, the certificate serial number of the sending terminal and the padding data. The initial authentication code is added to the end of the authentication chain before sending the message; The receiving device is used to parse the authentication chain of the received IPv6 message, extract the certificate serial number in each authentication code, and search the certificate corresponding to each authentication code to obtain the public key; calculate the signature value in the nth authentication code by calculating the hash value before the nth authentication code in the received IPv6 message, and input the public key, signature value and hash value corresponding to each authentication code into the signature verification algorithm for verification; if all authentication codes pass the signature verification and the receiving device is an intermediate receiving end, calculate the signature value according to the private key of the intermediate receiving end and the hash value of the IPv6 message before the mth authentication code, use the certificate serial number and signature value of the intermediate receiving end to generate the m+1th authentication code, and add it to the end of the authentication chain; if all authentication codes pass the signature verification and the receiving device is the final receiving end, send the IPv6 message to the application; where n≤m; m is the total number of authentication codes.
5. The message authentication system according to claim 4, characterized in that: The hash value before the nth authentication code in an IPv6 message is calculated as follows: Concatenate the IP payload, source address, destination address, protocol, and all bytes before the nth authentication code in the extension header into a continuous byte string; Calculate the hash value of a byte string; The signature value is calculated using the hash value, where the signature value is ECCSign(hash); hash is the hash value of the message.
6. The message authentication system according to claim 4 or 5, characterized in that: The intermediate receiving end is each security router on the message transmission path.
Citation Information
Patent Citations
Message hash chain construction method and device
CN113114471A
Message chain construction method and device, key chain generation method and device, message sending method and device and message receiving method and device
CN114726543A