Internet-oriented lightweight two-way synchronous secure communication method and system

Through Niederreiter public key cryptography and AES encryption technology, combined with ciphertext camouflage and counter control, the problem of insufficient key management and encryption strength in secure Internet communications is solved, efficient and secure identity authentication and data encryption are achieved, and communication is improved. safety and practicality.

CN118631498APending Publication Date: 2024-09-10NARI INFORMATION & COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410646430.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing Internet secure communication methods and models have security problems in key management, encryption strength, and digital signature authentication. In particular, the SSL protocol has complex key management, insufficient encryption strength, and lack of digital signature functions.

Method used

A lightweight two-way synchronous secure communication method based on Niederreiter public key cryptography is used to achieve identity verification, data encryption and communication synchronization through identity authentication, AES encryption and ciphertext camouflage technology. Counters are used to control the number of errors and ciphertext re-encoding is introduced. Technology enhances security.

Benefits of technology

It improves the comprehensiveness and practicality of secure Internet communications, enhances the security performance of identity authentication, reduces computational complexity, improves encryption efficiency, and increases the difficulty of attacks through ciphertext re-encoding, ensuring the confidentiality and confidentiality of communication data. reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631498A
    Figure CN118631498A
Patent Text Reader

Abstract

The invention discloses an internet-oriented lightweight two-way synchronous secure communication method, which comprises the following steps of: acquiring user identity identification information, authenticating a user identity, generating a random vector, calculating a Hash value to obtain a first function value, encrypting the user identity identification information, and calculating by using a decryption function and a private key to obtain a second function value, judging whether the first function value is equal to the second function value; recording the number of authentication failures, and judging whether the number of authentication failures exceeds an error threshold; decrypting the successfully authenticated encrypted data according to the AES encryption information to obtain original data, grouping the original data to obtain a new bit string, performing AES encryption, splitting the encrypted bit string to obtain first encrypted data, grouping the first encrypted data to obtain a coding wheel, expanding the coding wheel to obtain a first coding wheel, and performing 0 * 4E adding operation to obtain a second coding wheel; and arranging the data of the first coding round, and converting a bit string into a Chinese character string by using a coding rule, so that the security of the data is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a lightweight two-way synchronous secure communication method and system for the Internet. Background Art

[0002] In recent years, State Grid Corporation has made a series of achievements in the research related to terminal protection, channel protection and boundary protection of its information intranet. A security access system for internal applications of the company has gradually taken shape. Protection technology based on two-way identity authentication and full encryption of transmitted data has been applied in information intranet security protection equipment. Through two-way identity authentication between power terminals and master station systems, a trust relationship is established between power terminals and master station system servers. Due to the high professionalism of internal power business, the types and methods of interaction between terminals and master station system servers are relatively unified. Therefore, the access rights required by various types of power terminals are basically similar. The key goal of intranet access protection is to ensure that the terminal identity cannot be forged and the power control commands cannot be tampered with. The focus of related research is also on solving the "mutual trust" problem between terminals and businesses. However, with the continuous development of Internet-oriented services in the power system, Internet-oriented applications have greatly exceeded traditional power applications in terms of the frequency and content of information interaction. A large number of terminals such as non-controlled new energy, load control, and power Internet of Things are ubiquitously connected, and the source, grid, load, and storage interact collaboratively. A large amount of power business data interacts between the power communication private network and the Internet. With the development of business, the scale of this interaction has grown rapidly. While bringing profound changes to power information services, it has also introduced new risks, mainly manifested as follows: (1) The interactive characteristics have led to the exposure of the original closed power grid business system to the outside world, creating more attack points; (2) The complexity of the interaction mode between business systems and terminals has increased the risk of key data in the interaction process, and existing security equipment is difficult to ensure the confidentiality and reliability of the interaction; (3) The security awareness of external users varies, and their behavior is very random. The equipment, method, time, etc. used by users when accessing are unknown to the power grid, and the controllability is very poor. This has put forward new requirements for the protection capability and business support capability of the first line of defense of the information external network.

[0003] The existing Internet-oriented secure communication methods and models are based on the SSL (Secure Socket Layer) network security communication protocol, which is a security protocol implemented on the transport communication protocol (TCP / IP). However, it faces the following security issues: (1) Key management issues. Designing a secure and secret key exchange protocol is very complex. Therefore, the SSL handshake protocol also has some key management issues. The problems of SSL are as follows: when the client and the server send each other the encryption algorithms they can support, they are transmitted in plain text, which may be modified by attacks; SSL V3.0 may reduce security in order to be compatible with previous versions; all session keys will generate a master key, and the security of the handshake protocol depends entirely on the protection of the master key. Therefore, the master key should be used as little as possible in communication; encryption strength issues. Netscape uses 40-bit keys in its international version of the browser and server in accordance with the regulations of the US Department of the Interior. The RC4 regulation, named after the RC4 derivation used by SSL, restricts the export of encryption key products with a length of more than 40 bits. This regulation makes Netscape's 128-bit encryption key illegal outside the United States. This makes the SSL encryption strength very weak, the transaction risk is too high, and it cannot meet the security requirements of online transactions; Digital signature problem The SSL protocol does not have a digital signature function, that is, it does not have an anti-repudiation service. If you want to add a digital signature function, you need to add a "patch" to the protocol. In this way, it is used for both encryption keys and digital signatures, which has security loopholes. Later, the PKI (public key infrastructure) system improved this measure, that is, the dual-key mechanism, which separates the encryption key and the digital signature key, and becomes a dual-certificate mechanism. This is a complete PKI security service system. Summary of the invention

[0004] In view of the above-mentioned problems, the present invention is proposed.

[0005] Therefore, the technical problem solved by the present invention is: the present invention solves the security problems existing in the existing Internet security communication methods and models in terms of key management, encryption strength, digital signature authentication, etc.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a lightweight two-way synchronous secure communication method for the Internet, comprising:

[0008] Obtain user identity information and authenticate the user identity, wherein the authentication includes generating a random vector and calculating a hash value to obtain a first function value, encrypting the user identity information using a public key of a public key cryptographic system, calculating a second function value using a decryption function and a private key, and determining whether the first function value is equal to the second function value. If they are equal, the authentication is successful, otherwise the authentication fails;

[0009] Record the number of authentication failures and determine whether the number of authentication failures exceeds the error threshold. If not, check whether the Hash value obtained from the number of authentication failures meets the authentication conditions. If so, the authentication is successful.

[0010] Decrypt the successfully authenticated encrypted data according to the AES encryption information to obtain the original data, group the original data to obtain a new bit string, perform AES encryption on the new bit string using the AES key, and split the encrypted bit string to obtain the first encrypted data;

[0011] The first encrypted data is grouped to obtain a coding wheel, and the coding wheel is expanded to obtain a first coding wheel. The first coding wheel is added with 0x4E to ensure that the bit string of the first coding wheel is within the range interval. The data of the first coding wheel is arranged, and the bit string is converted into a Chinese character string using the coding rule, which is the coding result.

[0012] As a preferred solution of the lightweight two-way synchronous secure communication method for the Internet described in the present invention, wherein: the public key cryptography system is the Niederreiter public key cryptography system, and identity authentication using the Niederreiter public key cryptography system includes:

[0013] Generate a random vector r1, and calculate the first Hash function value S1=h(r1) of the random vector;

[0014] Send the first function value S1, generate a random vector r2, and calculate the hash function value S2=h(r2) of the random vector r2;

[0015] Using the encryption function E and the public key Kpu, we can calculate C=EKpu(ID||S1||S2);

[0016] Use the decryption function D and the private key Kpr to calculate DKpr(C)=ID||S′1||S′2 to obtain the user ID and the second function value S′1;

[0017] Determine whether S′1 is equal to S1. If so, the user identity verification is successful.

[0018] If not, user authentication fails.

[0019] As a preferred solution of the lightweight two-way synchronous secure communication method for the Internet described in the present invention, recording the number of authentication failures and determining whether the number of authentication failures exceeds the error threshold includes:

[0020] If the user identity authentication fails, the hash chain update operation will not be performed, and the number of authentication failures will be recorded;

[0021] If the number of recorded authentication failures exceeds the error threshold, all nodes on the hash chain will be deleted and a new hash chain generation process will be started;

[0022] If the number of authentication failures is within the specified error threshold, additional authentication failures are calculated and compared to check whether the additional authentication failures have a hash value that meets the authentication conditions. If so, the user identity authentication is successful and the number of authentication failures is set to 0.

[0023] As a preferred solution of the lightweight two-way synchronous secure communication method for the Internet described in the present invention, encrypting the original data using the AES encryption algorithm includes:

[0024] The original data is grouped into bits of the same length, m groups of data are extracted every n groups, and the extracted data are arranged in the original order into a new bit string;

[0025] Perform AES encryption on the new bit string using the AES key to obtain an encrypted bit string;

[0026] The encrypted bit string is split according to the product bits of the length and m, and each group obtained by the split is backfilled into the original data after the data is extracted according to the original extraction order to obtain the first encrypted data.

[0027] As a preferred solution of the lightweight two-way synchronous secure communication method for the Internet described in the present invention, encoding the first encrypted data includes:

[0028] The first encrypted data is grouped to form a coding round, and when the number of bits of the last group of the last coding round is insufficient, the number of bits of the original data is retained unchanged;

[0029] The bit group in the encoding round is expanded to obtain a new bit group, namely the first encoding round, and an operation of adding 0x4E is performed on the high byte of the new bit group so that the bit string of the new bit group is within the range interval.

[0030] As a preferred solution of the lightweight two-way synchronous secure communication method for the Internet described in the present invention, the data of the first encoding round is arranged, and the bit string is converted into a Chinese character string using the encoding rule, that is, the encoding result includes:

[0031] If the original data length of the last packet is insufficient in the last encoding round, 0 bits are added to the end of the packet as padding bits to obtain a complete bit packet;

[0032] Arrange all the groups of the same coding wheel in the original order to form the expanded data, and arrange the data of the coding wheel in sequence;

[0033] The bit string is converted into Chinese characters using the UCS-2 encoding rule, that is, the encoded data, and the encoded data is decoded into the original encrypted data using the UCS-2 encoding rule.

[0034] As a preferred solution of the lightweight two-way synchronous secure communication method for the Internet described in the present invention, wherein: using the UCS-2 encoding rule to decode the encoded data into encrypted data that has been successfully authenticated includes:

[0035] The encoded data is grouped to form decoding rounds. If the last decoding round does not satisfy the status, the incomplete group status is retained;

[0036] For the decoding round that has reached the full group state, perform a 0x4E subtraction operation on the high byte of each decoded packet, remove the 0 bits on the highest 2 bits of the high byte of each decoded packet, and re-shift and re-sort the data;

[0037] For the last decoding round that is not full of a group, calculate the number of groups N contained, subtract 1 from the number of groups to get the actual data before encoding, which is 2×(N-1) bytes in length. For the first N groups of the corresponding encoding round, perform the operation of subtracting 0x4E from the high byte of each group, remove the 0 bits from the highest 2 bits, and shift and sort. After completion, 2×(N-1) complete bytes are obtained, which is the decoded data.

[0038] In a second aspect, the present invention provides a system for lightweight two-way synchronous secure communication for the Internet, comprising:

[0039] An authentication module is used to obtain user identity information and authenticate the user identity, wherein the authentication includes generating a random vector and calculating a hash value to obtain a first function value, encrypting the user identity information using a public key of a public key cryptographic system, calculating a second function value using a decryption function and a private key, and determining whether the first function value is equal to the second function value. If so, the authentication is successful, otherwise the authentication fails.

[0040] The judgment module is used to record the number of authentication failures and judge whether the number of authentication failures exceeds the error threshold. If not, it checks whether the Hash value obtained in the number of authentication failures meets the authentication conditions. If so, the authentication is successful.

[0041] An encryption module, used to decrypt the successfully authenticated encrypted data according to the AES encryption information to obtain the original data, group the original data to obtain a new bit string, perform AES encryption on the new bit string using the AES key, and split the encrypted bit string to obtain the first encrypted data;

[0042] The encoding module is used to group the first encrypted data to obtain an encoding wheel, expand the encoding wheel to obtain a first encoding wheel, add 0x4E operation to the first encoding wheel to ensure that the bit string of the first encoding wheel is within the range interval, arrange the data of the first encoding wheel, and use the encoding rules to convert the bit string into a Chinese character string, which is the encoding result.

[0043] In a third aspect, the present invention provides a computing device, comprising:

[0044] Memory and processor;

[0045] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the lightweight two-way synchronous secure communication method for the Internet are implemented.

[0046] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the lightweight two-way synchronous secure communication method for the Internet.

[0047] Beneficial effects of the present invention: The lightweight two-way synchronous secure communication method for the Internet proposed in the present invention proposes the design of secure communication methods and models from the dimensions of identity authentication and key negotiation, communication data encryption, ciphertext disguise and communication synchronization, and comprehensively considers the secure communication issues in the interaction between the power information network and the Internet. Compared with the existing methods, the comprehensiveness and practicality of the model are improved. The identity authentication method based on the Niederreiter public key cryptography system has higher security performance, lower computational complexity and higher implementation efficiency. An improved one-way Hash chain is used for authentication. At the same time, the number of errors is controlled by setting a counter to prevent the domino effect from causing all subsequent verifications to fail. Verification comparison and corrective measures are carried out in a timely manner, and ciphertext re-encoding technology is introduced to increase the difficulty for attackers to decipher data. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0049] Figure 1 An overall flow chart of a lightweight two-way synchronous secure communication method for the Internet provided by the present invention;

[0050] Figure 2 The invention provides a lightweight two-way synchronous secure communication method for the Internet, wherein m and n are both 1, and the AES encryption algorithm performs encryption on the original data;

[0051] Figure 3 The invention provides a lightweight two-way synchronous secure communication method for the Internet, wherein m and n are both 1, and the AES encryption algorithm performs decryption on the original data;

[0052] Figure 4 A schematic diagram of a single character encoding based on the UCS-2 Chinese character set for a lightweight two-way synchronous secure communication method for the Internet provided by the present invention;

[0053] Figure 5 A schematic diagram of encoding based on the UCS-2 Chinese character set for a lightweight two-way synchronous secure communication method for the Internet provided by the present invention;

[0054] Figure 6 A decoding schematic diagram of a UCS-2 Chinese character set based on a lightweight two-way synchronous secure communication method for the Internet provided by the present invention. DETAILED DESCRIPTION

[0055] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0056] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0057] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0058] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0059] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0060] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0061] Example 1

[0062] Reference Figure 1-6 , which is an embodiment of the present invention, provides a lightweight two-way synchronous secure communication method for the Internet, comprising:

[0063] S100: Obtain user identity information and authenticate the user identity, wherein the authentication includes generating a random vector and calculating a hash value to obtain a first function value, encrypting the user identity information using a public key of a public key cryptographic system, calculating a second function value using a decryption function and a private key, and determining whether the first function value is equal to the second function value. If they are equal, the authentication is successful, otherwise the authentication fails.

[0064] Furthermore, a random vector r1 is generated, and the first Hash function value S1=h(r1) of the random vector is calculated;

[0065] Send the first function value S1, generate a random vector r2, and calculate the hash function value S2=h(r2) of the random vector r2;

[0066] Using the encryption function E and the public key Kpu, we can calculate C=EKpu(ID||S1||S2);

[0067] Use the decryption function D and the private key Kpr to calculate DKpr(C)=ID||S′1||S′2 to obtain the user ID and the second function value S′1;

[0068] Determine whether S′1 is equal to S1. If so, the user identity verification is successful.

[0069] If not, user authentication fails.

[0070] It should be noted that the public key cryptographic system includes the McEliece public key cryptographic system, the RSA public key cryptographic system and the Niederreiter public key cryptographic system. The Niederreiter public key cryptographic system is preferred in this method. The Niederreiter system directly uses the check matrix for encryption. Compared with McEliece and RSA, the error vector is added in the encryption process, which simplifies the encryption calculation process, reduces the calculation complexity, and is conducive to reducing the communication overhead and storage requirements, thereby enhancing security.

[0071] Specifically, when authentication begins, the user terminal device sends a service request to the server, and the server uses a built-in random number generator to generate a random vector r1 and calculates its hash function value S1=h(r1). The server sends S1 and the user identity authentication request to the user terminal device; after the user terminal device receives S1 and the verification request sent by the server, it generates another random vector r2 and calculates its hash function S2=h(r2). Then, the encryption function E and public key Kpu written into the user terminal device are used to calculate C=EKpu(ID||S1||S2), and C is sent to the server; after the background server receives C, it uses the decryption function D and private key Kpr written into the server to calculate DKpr(C)=ID||S′1||S′2, thereby obtaining the user terminal device ID, S′1 and S′2; verify whether S′1 is equal to the received S1. If not, it means that the attacker used the previous communication data to disguise himself as a legitimate user terminal device to implement a replay attack, and the authentication failed, and the subsequent authentication process will not be carried out; if they are equal, it means that the user terminal device is legitimate, that is, the server has realized the legitimacy verification of the user identity of the user terminal device.

[0072] It should also be noted that the user terminal device stores the user identity information (ID), the encryption function E and the public key Kpu (Kpu=K) based on the Niederreiter public key cryptography system, and the background server stores the decryption function D and the private key Kpr (Kpr=(S,H,P)). During the authentication process, the user encrypts the user identity information with the public key of the Niederreiter public key cryptography system, and the service provider's server decrypts the ciphertext with the corresponding private key after receiving the ciphertext to obtain the user ID information. Since the attacker cannot successfully decipher the private keys H, P and S, and it is also very difficult to directly decipher the ciphertext without being able to decipher the private key, the Niederreiter public key system has a high security, and the attacker cannot obtain the user identity information.

[0073] S200: Record the number of authentication failures and determine whether the number of authentication failures exceeds the error threshold. If not, check whether the Hash value obtained from the number of authentication failures meets the authentication condition. If so, the authentication is successful.

[0074] Furthermore, if the user identity authentication fails, the hash chain update operation is not performed, and the number of authentication failures is recorded;

[0075] If the number of recorded authentication failures exceeds the error threshold, all nodes on the hash chain will be deleted and a new hash chain generation process will be started;

[0076] If the number of authentication failures is within the specified error threshold, additional authentication failures are calculated and compared to check whether the additional authentication failures have a hash value that meets the authentication conditions. If so, the user identity authentication is successful and the number of authentication failures is set to 0.

[0077] It should be noted that due to the uncertainty of the Internet network, if an accident occurs, such as communication packet loss or other unexpected situations, or a malicious attacker uses the active attack of replacing the message body, then the verification will not pass, so the user-side client will not replace the node, but the server side has already used the current node, and will use the next node for the next verification. The consequence of this is that the subsequent verification will not pass, and it will produce a domino effect, that is, all subsequent verifications will not pass. However, if the server learns that the last verification did not pass, if the last node is reused in this verification, the verification can pass. Because the node has been used, the attacker can use the message sent by the server last time to learn the server information, and it is possible to impersonate the server to achieve authentication, so the node that has been used must be invalidated.

[0078] Specifically, an error counter Iu is set on the client side. If the server verification fails, the client does not perform the Hash chain update operation, and the counter Iu is incremented by 1. The counter is used to record the number of consecutive errors from the last correct verification to the current verification. If the number of times recorded by the counter exceeds the error threshold L, the user's client will notify the server and delete all nodes on the Hash chain and start a new Hash chain generation process. If the number of times recorded by the counter is within the specified upper limit L, the next verification will be performed, and the client side will perform additional Iu calculations and comparison operations to check whether the Hash value obtained after the additional Iu calculations meets the authentication conditions. If qualified, the corresponding storage value is updated and Iu is set to 0.

[0079] The error threshold is set according to the strictness of the security requirements of the business system. If the security requirements are relatively high, then if an error occurs once, L=1, the Hash chain will be regenerated. If the security requirements are relatively low, then L can be set higher, L=5, and the Hash chain will be regenerated. In this method, L=3.

[0080] It should also be noted that when the server sends out Hash chain information and the client side does not receive it, a similar invalidation counter Is is set on the server. Each time the verification information is sent and the authentication is not successful, the Is value is increased by 1. When requesting verification, the Is and Hash values ​​are transmitted to the user side together. When the user side receives the request, it compares Iu and Is+1, and sets the larger value as I. The user side performs an additional I Hash value calculations to see if there is a value that meets the authentication conditions. If so, it feedbacks the authentication success to the server and sets Iu to 0. After the server confirms, it sets Is to 0.

[0081] S300: decrypting the authenticated encrypted data according to the AES encryption information to obtain the original data, grouping the original data to obtain a new bit string, performing AES encryption on the new bit string using the AES key, and splitting the encrypted bit string to obtain first encrypted data;

[0082] Furthermore, the original data is grouped according to bits of the same length, m groups of data are extracted every n groups, and the extracted data are arranged into a new bit string in the original order;

[0083] Perform AES encryption on the new bit string using the AES key to obtain an encrypted bit string;

[0084] The encrypted bit string is split according to the product bits of the length and m, and each group obtained by the split is backfilled into the original data after the data is extracted according to the original extraction order to obtain the first encrypted data.

[0085] It should be noted that if Figure 2As shown, the original data to be sent is encrypted according to the AES encryption information, the original data is grouped according to the length of each group of 128 bits, m groups of data are extracted every n groups and the extracted data are arranged into a new bit string in the original sequence; the obtained new bit string is encrypted by AES using the AES key recorded in the communication establishment phase to obtain an encrypted bit string; the encrypted bit string is split according to the length of each group of 128×m bits, and the groups obtained by the split are backfilled into the data to be encrypted after the extracted data in the original extraction order to obtain the encrypted data.

[0086] like Figure 3 As shown, the encrypted data is decrypted according to the AES encryption information, the encrypted data is grouped according to the length of each group of 128 bits, m groups of data are extracted every n groups, and the extracted data are arranged into a new bit string in the original sequence; the obtained new bit string is decrypted by AES using the recorded AES key to obtain the decrypted bit string; the decrypted bit string is split according to the length of each group of 128×m bits, and the groups obtained by the split are backfilled into the encrypted data after the data is extracted in the original extraction order to obtain the decrypted original data.

[0087] S400: Grouping the first encrypted data to obtain a coding wheel, expanding the coding wheel to obtain a first coding wheel, adding 0x4E to the first coding wheel to ensure that the bit string of the first coding wheel is within the range interval, arranging the data of the first coding wheel, and converting the bit string into a Chinese character string using a coding rule, which is the coding result;

[0088] Furthermore, the first encrypted data is grouped to form a coding round, and when the number of bits of the last group of the last coding round is insufficient, the number of bits of the original data is retained unchanged;

[0089] Expand the bit group in the encoding round to obtain a new bit group, i.e., the first encoding round, and perform an add 0x4E operation on the high byte of the new bit group so that the bit string of the new bit group is within the range interval;

[0090] If the original data length of the last packet is insufficient in the last encoding round, 0 bits are added to the end of the packet as padding bits to obtain a complete bit packet;

[0091] Arrange all the groups of the same coding wheel in the original order to form the expanded data, and arrange the data of the coding wheel in sequence;

[0092] The bit string is converted into Chinese characters using the UCS-2 encoding rule, that is, the encoded data, and the encoded data is decoded into the original encrypted data using the UCS-2 encoding rule.

[0093] It should be noted that if Figure 4 As shown, the core of using UCS-2 encoding to implement character encoding is to transform the ciphertext into a data format that conforms to UCS-2 encoding through operations such as shift mapping. The encoding area of ​​Chinese characters under UCS-2 encoding is 0x4E00-0x9FBF. Under the condition that the low byte can take 0x00-0xFF, the high byte can take 0x4E-0x9E, a total of 81 valid values. Considering that every 2 bytes of the final ciphertext data result are distributed in 0x0000-0xFFFF, in order to achieve effective mapping, the single character encoding is as follows: take a bit group c = (c0, c2, ..., c13) with a length of 14 from the original ciphertext; the last 8 bits (c6-c13) of the bit group c form the byte B1; add 2 bits with a value of 0 before the first 6 bits of data in the bit group c to form the byte B0; at this time, the value range of B0 is 0x00-0x3F. In order to ensure that the value of B0 is mapped to the legal range of UCS-2 Chinese characters, add 0x4E to the value of B0 to obtain a new B0. With B0 as the high byte and B1 as the low byte, a double-byte bit string B is formed. This bit string B can be directly converted into a Chinese character that complies with the UCS-2 encoding rules. A single character based on UCS-2 encoding can be obtained;

[0094] Specifically, Figure 5 As shown, based on the single-character encoding scheme of the UCS-2 Chinese character set, the encoding scheme of the complete ciphertext includes: grouping the first encrypted data into 14 bits, and each 8 groups (a total of 112 bits) form a coding round. When the last group of the last coding round has insufficient bits (that is, the original ciphertext length is not an integer multiple of 14), the group retains the original data bits unchanged; for each 14-bit group in each complete coding round, two 0 bits are added before the first bit so that the original single group length is extended from 14 bits to 16 bits; and the high byte of each new 16-bit group in the coding round is added with 0 x4E operation is performed to make the 16-bit value between 0x4E00 and 0x8DFF. If the original data length of the last group in the last coding round is less than 14 bits (set to N), 14-N 0 bits are added to the end of the group as padding bits to form a complete 14-bit group, and then each group in the coding round is mapped. All groups of the same coding round are arranged in the original order to form extended data. After arranging the data of each coding round in turn, the final bit string is converted into a Chinese character string using the UCS-2 encoding rules, and this character string is used as the final encoded result.

[0095] Furthermore, the encoded data is grouped to form decoding rounds, and if the last decoding round does not satisfy the state, the incomplete group state is retained;

[0096] For the decoding round that has reached the full group state, perform a 0x4E subtraction operation on the high byte of each decoded packet, remove the 0 bits on the highest 2 bits of the high byte of each decoded packet, and re-shift and re-sort the data;

[0097] For the last decoding round that is not full of a group, calculate the number of groups N contained, subtract 1 from the number of groups to get the actual data before encoding, which is 2×(N-1) bytes in length. For the first N groups of the corresponding encoding round, perform the operation of subtracting 0x4E from the high byte of each group, remove the 0 bits from the highest 2 bits, and shift and sort. After completion, 2×(N-1) complete bytes are obtained, which is the decoded data.

[0098] It should be noted that if Figure 6 As shown, the received encoded data composed of UCS-2 characters is converted into bit string data using the UCS-2 encoding rule; the received encoded bit string is grouped into 16-bit decoding groups, and each 8 groups form a decoding round. If the length of the data to be decoded is not an integer multiple of 128, that is, the last decoding round does not reach the full group state of 8 groups, it is retained as an incomplete group state; for all decoding rounds that have reached the full group state, a 0x4E operation is performed on the high byte of each decoding group, the 0 bits on the highest 2 bits of the high byte of each decoding group are removed, and the data is shifted and re-sorted to restore each group of 128-bit data to the original 112-bit data; if there is In the last decoding round of an incomplete group, it is grouped by 16 bits, and the number of groups it contains is calculated (here it is assumed to be N, N<8). When the ciphertext length is an integer multiple of 16, the number of groups is reduced by 1 to obtain the actual pre-encoded data length of 2×(N-1) bytes. For the first N groups of this encoding round, each high byte is reduced by 0x4E, the highest 2 bits are removed from 0 bits, and the shift sorting is performed. After completion, 2×(N-1) complete bytes can be obtained. At this time, the 0 bits used as padding bits during encoding are just discarded, and 2×(N-1) bytes are the actual valid decoded data, which can complete the work of restoring the encoded data to the original encrypted ciphertext.

[0099] The above is a schematic scheme of a lightweight two-way synchronous secure communication method for the Internet in this embodiment. It should be noted that the technical scheme of the device for lightweight two-way synchronous secure communication for the Internet and the technical scheme of the above-mentioned lightweight two-way synchronous secure communication method for the Internet belong to the same concept. For details not described in detail in the technical scheme of the device for lightweight two-way synchronous secure communication for the Internet in this embodiment, please refer to the description of the technical scheme of the above-mentioned lightweight two-way synchronous secure communication method for the Internet.

[0100] The device for lightweight two-way synchronous secure communication for the Internet in this embodiment includes:

[0101] An authentication module is used to obtain user identity information and authenticate the user identity, wherein the authentication includes generating a random vector and calculating a hash value to obtain a first function value, encrypting the user identity information using a public key of a public key cryptographic system, calculating a second function value using a decryption function and a private key, and determining whether the first function value is equal to the second function value. If so, the authentication is successful, otherwise the authentication fails.

[0102] The judgment module is used to record the number of authentication failures and judge whether the number of authentication failures exceeds the error threshold. If not, it checks whether the Hash value obtained in the number of authentication failures meets the authentication conditions. If so, the authentication is successful.

[0103] An encryption module, used to decrypt the successfully authenticated encrypted data according to the AES encryption information to obtain the original data, group the original data to obtain a new bit string, perform AES encryption on the new bit string using the AES key, and split the encrypted bit string to obtain the first encrypted data;

[0104] The encoding module is used to group the first encrypted data to obtain an encoding wheel, expand the encoding wheel to obtain a first encoding wheel, add 0x4E operation to the first encoding wheel to ensure that the bit string of the first encoding wheel is within the range interval, arrange the data of the first encoding wheel, and use the encoding rules to convert the bit string into a Chinese character string, which is the encoding result.

[0105] This embodiment also provides a computing device, which is applicable to lightweight two-way synchronous secure communication for the Internet, including:

[0106] A memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement a lightweight two-way synchronous secure communication method for the Internet as proposed in the above embodiment.

[0107] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for realizing a lightweight two-way synchronous secure communication for the Internet as proposed in the above embodiment is implemented.

[0108] The storage medium proposed in this embodiment and the method for implementing lightweight bidirectional synchronous secure communication for the Internet proposed in the above embodiment belong to the same inventive concept. The technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0109] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ReadOnly, Memory, ROM), random access memory (RandomAccess Memory, RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention.

[0110] Example 2

[0111] This embodiment is different from the first embodiment in that it provides a verification test of a lightweight two-way synchronous secure communication method for the Internet, in order to verify and illustrate the technical effects adopted in this method.

[0112] Combined with the proposed lightweight two-way synchronous secure communication method, a secure communication program was developed to authenticate the communication terminal and encrypt the transmitted data. The secure communication program is mainly responsible for establishing and maintaining secure transmission channels for access terminals and services, intercepting, access controlling, and forwarding application data, and using the AES packet data encryption algorithm to encrypt and decrypt data.

[0113] Key negotiation and basic identity authentication, the present invention is applied to the SSL (Secure Socket Layer / Trans portLayer Security) protocol, a secure transmission protocol, which is widely used in application scenarios that require secure network transmission, such as HTTPS; the handshake protocol family consists of three sub-protocols: the password specification change protocol, the handshake protocol, and the alarm protocol, which are used for both parties to negotiate security parameters (keys for encryption and decryption) for use in the record layer, perform identity authentication, and report errors to the other party. It is a prerequisite for data encryption.

[0114] The SSL protocol provides an identity authentication mechanism based on the PKI system, which can use digital certificates to verify its basic identity, but the disadvantage is that it cannot distinguish the access rights of different clients to resources. However, in actual application scenarios, after the user and the platform have established a VPN tunnel, it is necessary to subdivide the permissions of different users. After the VPN tunnel handshake is completed, the user sends its own digital certificate, terminal hardware information (ID of the dedicated chip), and terminal health scan results to the secure communication program through an encrypted tunnel. The secure communication program compares this information with the corresponding terminal information in the background database, obtains the permissions of the terminal, and returns it to the client. The user and the business each establish an access control mechanism for the permission information.

[0115] After determining the key required to encrypt and decrypt application data based on the identity authentication and key negotiation mechanism, the application data of the actual communicating parties is compressed, encrypted and encapsulated into the SSL record layer protocol and forwarded to the peer SSL VPN device for restoration to achieve data transmission confidentiality.

[0116] This method proposes for the first time the design of secure communication methods and models from the dimensions of identity authentication and key negotiation, communication data encryption, ciphertext disguise and communication synchronization, comprehensively considering the secure communication issues in the interaction between the power information network and the Internet. Compared with the existing methods, the comprehensiveness and practicality of the model are improved; the identity authentication method based on the Niederreiter public key cryptography system, the Niederreiter public key cryptography system is based on the difficulty of large matrix decomposition. Compared with the protocol using symmetric encryption and RSA public key encryption, it has higher security performance, lower computational complexity and higher implementation efficiency. It is suitable for use on user terminal devices with limited resources and is suitable for power interconnection scenarios with massive IoT devices connected. The validity authentication method for both parties of Internet interaction with error control adopts an improved one-way Hash chain for authentication, and controls the number of errors by setting a counter to prevent the domino effect from causing all subsequent verifications to fail, and conducts verification comparison and corrective measures in a timely manner; the packet data partial encryption interaction scheme based on the AES encryption algorithm, in order to improve the efficiency of the packet symmetric encryption algorithm without reducing the security of the algorithm, the encrypted data is grouped according to the length of each group of 128 bits, and m groups of data are extracted every n groups and the extracted data are arranged in the original order into a new bit string for dynamic encryption partial selection; the encrypted data recoding model based on Chinese encoding, on the basis of encrypting the transmission data, considering the enhancement of data security, can introduce ciphertext recoding technology, which belongs to the field of information hiding, makes certain changes to the data, increases the difficulty for attackers to decipher the data, and even deceives the attackers to induce the attackers to think that the data does not contain valid information, thereby enhancing the security of data communication. On the basis of the introduction of identity authentication, data encryption, and communication synchronization confirmation in the previous section of the patent, the text-based ciphertext recoding is introduced to disguise the data as text format information.

[0117] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A lightweight two-way synchronous secure communication method for the Internet, characterized in that: include: Obtain user identity information and authenticate the user identity, wherein the authentication includes generating a random vector and calculating a hash value to obtain a first function value, encrypting the user identity information using a public key of a public key cryptographic system, calculating a second function value using a decryption function and a private key, and determining whether the first function value is equal to the second function value. If they are equal, the authentication is successful, otherwise the authentication fails; Record the number of authentication failures and determine whether the number of authentication failures exceeds the error threshold. If not, check whether the Hash value obtained from the number of authentication failures meets the authentication conditions. If so, the authentication is successful. Decrypt the successfully authenticated encrypted data according to the AES encryption information to obtain the original data, group the original data to obtain a new bit string, perform AES encryption on the new bit string using the AES key, and split the encrypted bit string to obtain the first encrypted data; The first encrypted data is grouped to obtain a coding wheel, and the coding wheel is expanded to obtain a first coding wheel. The first coding wheel is added with 0x4E to ensure that the bit string of the first coding wheel is within the range interval. The data of the first coding wheel is arranged, and the bit string is converted into a Chinese character string using the coding rule, which is the coding result.

2. The lightweight two-way synchronous secure communication method for the Internet as claimed in claim 1, characterized in that: The public key cryptography system is the Niederreiter public key cryptography system, and identity authentication using the Niederreiter public key cryptography system includes: Generate a random vector r1, and calculate the first Hash function value S1=h(r1) of the random vector; Send the first function value S1, generate a random vector r2, and calculate the hash function value S2=h(r2) of the random vector r2; Using the encryption function E and the public key Kpu, we can calculate C=EKpu(ID||S1||S2); Use the decryption function D and the private key Kpr to calculate DKpr(C)=ID||S′1||S′2 to obtain the user ID and the second function value S′1; Determine whether S′1 is equal to S1. If so, the user identity verification is successful. If not, user authentication fails.

3. The lightweight two-way synchronous secure communication method for the Internet as claimed in claim 2, characterized in that: Record the number of authentication failures and determine whether the number of authentication failures exceeds the error threshold, including: If the user identity authentication fails, the hash chain update operation will not be performed, and the number of authentication failures will be recorded; If the number of recorded authentication failures exceeds the error threshold, all nodes on the hash chain will be deleted and a new hash chain generation process will be started; If the number of authentication failures is within the specified error threshold, additional authentication failures are calculated and compared to check whether the additional authentication failures have a hash value that meets the authentication conditions. If so, the user identity authentication is successful and the number of authentication failures is set to 0.

4. The lightweight two-way synchronous secure communication method for the Internet as claimed in claim 3, characterized in that: Encrypting the original data using the AES encryption algorithm includes: The original data is grouped into bits of the same length, m groups of data are extracted every n groups, and the extracted data are arranged in the original order into a new bit string; Perform AES encryption on the new bit string using the AES key to obtain an encrypted bit string; The encrypted bit string is split according to the product bits of the length and m, and each group obtained by the split is backfilled into the original data after the data is extracted according to the original extraction order to obtain the first encrypted data.

5. The lightweight two-way synchronous secure communication method for the Internet as claimed in claim 4, characterized in that: Encoding the first encrypted data includes: The first encrypted data is grouped to form a coding round, and when the number of bits of the last group of the last coding round is insufficient, the number of bits of the original data is retained unchanged; The bit group in the encoding round is expanded to obtain a new bit group, namely the first encoding round, and an operation of adding 0x4E is performed on the high byte of the new bit group so that the bit string of the new bit group is within the range interval.

6. The lightweight two-way synchronous secure communication method for the Internet as claimed in claim 5, characterized in that: Arrange the data of the first encoding round and use the encoding rules to convert the bit string into a Chinese character string, that is, the encoding result includes: If the original data length of the last packet is insufficient in the last encoding round, 0 bits are added to the end of the packet as padding bits to obtain a complete bit packet; Arrange all the groups of the same coding wheel in the original order to form the expanded data, and arrange the data of the coding wheel in sequence; The bit string is converted into Chinese characters using the UCS-2 encoding rule, that is, the encoded data, and the encoded data is decoded into the original encrypted data using the UCS-2 encoding rule.

7. The lightweight two-way synchronous secure communication method for the Internet as claimed in claim 1 or 6, characterized in that: Using the UCS-2 encoding rules to decode the encoded data into successfully authenticated encrypted data includes: The encoded data is grouped to form decoding rounds. If the last decoding round does not satisfy the status, the incomplete group status is retained; For the decoding round that has reached the full group state, perform a 0x4E subtraction operation on the high byte of each decoded packet, remove the 0 bits on the highest 2 bits of the high byte of each decoded packet, and re-shift and re-sort the data; For the last decoding round that is not full of a group, calculate the number of groups N contained, subtract 1 from the number of groups to get the actual data before encoding, which is 2×(N-1) bytes in length. For the first N groups of the corresponding encoding round, perform the operation of subtracting 0x4E from the high byte of each group, remove the 0 bits from the highest 2 bits, and shift and sort. After completion, 2×(N-1) complete bytes are obtained, which is the decoded data.

8. A system for a lightweight two-way synchronous secure communication method for the Internet, characterized in that: include: An authentication module is used to obtain user identity information and authenticate the user identity, wherein the authentication includes generating a random vector and calculating a hash value to obtain a first function value, encrypting the user identity information using a public key of a public key cryptographic system, calculating a second function value using a decryption function and a private key, and determining whether the first function value is equal to the second function value. If so, the authentication is successful, otherwise the authentication fails. The judgment module is used to record the number of authentication failures and judge whether the number of authentication failures exceeds the error threshold. If not, it checks whether the Hash value obtained in the number of authentication failures meets the authentication conditions. If so, the authentication is successful. An encryption module, used to decrypt the successfully authenticated encrypted data according to the AES encryption information to obtain the original data, group the original data to obtain a new bit string, perform AES encryption on the new bit string using the AES key, and split the encrypted bit string to obtain the first encrypted data; The encoding module is used to group the first encrypted data to obtain an encoding wheel, expand the encoding wheel to obtain a first encoding wheel, add 0x4E operation to the first encoding wheel to ensure that the bit string of the first encoding wheel is within the range interval, arrange the data of the first encoding wheel, and use the encoding rules to convert the bit string into a Chinese character string, which is the encoding result.

9. An electronic device, characterized in that: The device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.