Door knocking authentication method and device based on TCP

Through the knock-on authentication method based on the TCP protocol, the user identity authentication information is split into fragments and sent sequentially, which solves the knock-on failure problem of single-packet authentication applications under the UDP protocol and improves the authentication success rate and security.

CN118802191APending Publication Date: 2024-10-18NINGXIA MOBILE COMM CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310992102.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-07
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing single-packet authentication applications that use the UDP protocol for single-packet authorization have a certain probability of knocking failure in the Internet environment, resulting in poor user perception of SDP software.

Method used

Using the knock authentication method based on the TCP protocol, the encrypted user identity authentication information is split into multiple fragments, and a knock message containing the fragment length and sending time is generated, which is sent to the server through the TCP protocol and is processed on the server side. Splicing and checking in order avoids restrictions on UDP messages.

Benefits of technology

The success rate of knock-knock authentication for single-package authentication applications is improved, and the adaptability and security in the Internet environment are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802191A_ABST
    Figure CN118802191A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication security, and provides a TCP-based door knocking authentication method and device. The method comprises the following steps: splitting encrypted user identity authentication information into a plurality of fragments, and generating door knocking messages corresponding to the plurality of fragments based on a TCP (Transmission Control Protocol); and sending the knock message to a server, so that the server splices the knock message according to the first identifier, and checks the user identity authentication information. According to the invention, a plurality of TCP knock messages carrying user identity authentication information fragments can be sent to the server in sequence in a fragmentation manner, and finally the TCP knock messages are spliced into complete user identity authentication information, so that an authentication function is realized, possible limitation of UDP messages on the Internet is avoided, and the success rate of single-packet authentication application knock authentication is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication security technology, and in particular to a TCP-based knocking authentication method and device. Background Art

[0002] At present, Single Packet Authorization (SPA) is the key technology of Software Defined Perimeter (SDP). Single Packet Authorization solves many defects of knocking technology and is a common authentication and port dynamic opening and closing method for current SDP software. Most of the current mainstream SPAs use User Datagram Protocol (UDP), but telecom operators have taken different degrees of restrictions on UDP protocol data packets, which makes single packet authentication applications have a certain probability of knocking failure, resulting in poor perception of SDP software use. Summary of the invention

[0003] The embodiment of the present application provides a TCP-based knocking authentication method and device to solve the technical problem that a single-packet authentication application using the UDP protocol has a certain probability of knocking failure.

[0004] In a first aspect, an embodiment of the present application provides a TCP-based knocking authentication method, including:

[0005] Split the encrypted user identity authentication information into multiple fragments, and generate knock messages corresponding to the multiple fragments based on the transmission control protocol TCP, the knock message at least includes first data, second data, third data and a first identifier, the first data carries the sum of the lengths of each fragment and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0006] The knock message is sent to a server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

[0007] In one embodiment, before sending the knock message to the server, the method further includes:

[0008] The knock message is sent according to the sequential transmission order of the first data, the second data and the third data, and the order of the multiple fragments in the second data is randomly disrupted.

[0009] In one embodiment, the encrypted user identity authentication information is obtained by encrypting the user identity authentication information based on an encryption algorithm.

[0010] In a second aspect, an embodiment of the present application provides a TCP-based knocking authentication method, including:

[0011] Receive a knock message sent by a client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0012] The knock message is spliced ​​according to the first identifier, and the user identity authentication information is verified.

[0013] In one embodiment, after receiving the knock message sent by the client, the method further includes:

[0014] determining, according to a first field in the knock message, whether the client has completed sending the knock message, wherein the first field is used to indicate whether the third data is received;

[0015] According to the second field in the knock message, it is determined whether to send a response message or a connection reset message to the client.

[0016] In one embodiment, after splicing the knock message according to the first identifier and verifying the user identity authentication information, the method further includes:

[0017] When it is determined that the user identity authentication information passes the verification, the service port is opened, and the service data sent by the client through the service port is received.

[0018] In a third aspect, an embodiment of the present application provides a TCP-based knock authentication device, including:

[0019] a first sending module, configured to split the encrypted user identity authentication information into multiple fragments, and generate knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0020] The second sending module is used to send the knock message to the server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

[0021] In a fourth aspect, an embodiment of the present application provides a TCP-based knock authentication device, including:

[0022] A first receiving module is used to receive a knock message sent by a client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, and the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0023] The second receiving module is used to splice the knock message according to the first identifier and verify the user identity authentication information.

[0024] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein when the processor executes the program, the TCP-based knocking authentication method described in the first aspect or the second aspect is implemented.

[0025] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the TCP-based knocking authentication method described in the first aspect or the second aspect.

[0026] The TCP-based knocking authentication method and device provided in the embodiment of the present application can fragment multiple TCP knocking messages carrying user identity authentication information fragments, send them sequentially to the server, and finally splice them into complete user identity authentication information to realize the authentication function, avoid the restrictions that UDP messages may be subject to on the Internet, and improve the success rate of knocking authentication in single-packet authentication applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0028] Figure 1 This is one of the flow charts of the TCP-based knocking authentication method provided in the embodiment of the present application;

[0029] Figure 2 is a schematic diagram of first data provided in an embodiment of the present application;

[0030] Figure 3 is a schematic diagram of second data provided in an embodiment of the present application;

[0031] Figure 4 is a schematic diagram of third data provided in an embodiment of the present application;

[0032] Figure 5 This is the second flow chart of the TCP-based knocking authentication method provided in the embodiment of the present application;

[0033] Figure 6 This is a flow chart of a TCP knocking authentication connection provided by an embodiment of the present application;

[0034] Figure 7 This is one of the structural diagrams of the TCP-based knocking authentication device provided in the embodiment of the present application;

[0035] Figure 8 This is the second structural diagram of the TCP-based knocking authentication device provided in the embodiment of the present application;

[0036] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] Due to the stateless and connectionless characteristics of the UDP protocol, it is more suitable for single-packet authentication applications. However, due to the fact that some telecom operators currently take varying degrees of restrictions on UDP protocol data packets, single-packet authentication applications have a certain probability of knock failure, and SDP software perception is poor. In order to ensure the accurate delivery of knock messages in complex Internet environments, this application provides a knock authentication method based on the Transmission Control Protocol (TCP), which is specifically implemented as follows:

[0039] Figure 1 This is one of the flow charts of the TCP-based knocking authentication method provided in the embodiment of the present application. Figure 1 , the embodiment of the present application provides a TCP-based knocking authentication method, which may specifically include:

[0040] Step 110, splitting the encrypted user identity authentication information into multiple fragments, and generating knock messages corresponding to the multiple fragments based on the transmission control protocol TCP, the knock message at least includes first data, second data, third data and a first identifier, the first data carries the sum of the lengths of each fragment and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0041] Step 120: Send the knock message to the server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

[0042] It should be noted that the execution subject of the above method may be specifically a client, more specifically an SDP client.

[0043] Optionally, the user authentication information may be obtained after being encrypted in advance, and the knock message may be a data message (such as a SYN message, i.e., a Synchronize message in TCP) obtained by processing multiple fragments corresponding to the encrypted user authentication information based on the TCP knock private protocol in this application. For example, the multiple fragments corresponding to the encrypted user authentication information are carried in the optional custom field in the TCP SYN message, encapsulated through the TCP knock private protocol, and the encrypted user authentication information is split into N fragments with a maximum of no more than 35 bytes according to the optional character length requirement. The data message includes a first record, a middle record, and a tail record.

[0044] Among them, the first record, the middle record and the tail record correspond to the first data, the second data and the third data respectively. The first data carries the sum of the lengths of each segment of a knock batch, and carries the sending time of the knock message (for example, it can be the timestamp of sending the knock message), without carrying any segments. For details, refer to Figure 2 The second data does not carry the sum of the lengths of the individual segments (length), nor does it carry the sending time of the knock message, but carries the individual segments of the user identity authentication information after being split. Figure 3 The third data carries the sending time of the knock message, for details, refer to Figure 4 The knock message also includes a first identifier, which can be specifically used to distinguish the first data, the second data, the third data, and each fragment of the third data. For example, the first identifier can be a serial number, starting from 0, representing the first data, and increasing in sequence, not exceeding 255; the first identifier can also be distinguished by using different pictures or text information, which is not specifically limited in this application.

[0045] Reference Figure 2-Figure 4 , using a custom knock protocol header to save and merge segmented user authentication information, where the fields in the TCP knock private protocol are described as follows:

[0046] knock_id: 30 bits in length, indicating the ID of a batch knock request from the client. A batch knock request includes the first record, middle record, and tail record.

[0047] The first field, field T: whether it is the tail record. If this bit is filled with 1, it means it is the tail record.

[0048] The second field R field: whether to trigger the server to return a response message ACK or a connection reset message RST. If this bit is 1, it means that the server is triggered to return ACK or RST.

[0049] The T / R field mainly solves the problem of excessive pressure on the knocking server caused by repeated retransmission of knocking messages due to TCP's automatic retransmission mechanism. If this bit is filled with 1, the server can construct an ACK or RST message to return to the client to prevent the client from repeatedly retransmitting knocking messages. This function may cause the knocking server to leak the IP address, which may cause the risk of SYN flood attacks. It needs to be configured according to the actual application scenario.

[0050] sequence: sequence number, starting from 0, indicating the first record, and increasing in sequence, not exceeding 255.

[0051] length: The sum of the lengths of all data fragments, which is only carried in the first record.

[0052] timestamp: Timestamp. This field is mainly used to prevent replay attacks. A knock message that is too early or later than the current time is considered an illegal request.

[0053] piece: Each fragment corresponding to the encrypted user authentication information.

[0054] The client splits the encrypted user authentication information into multiple fragments, and generates the first record, middle record, tail record and first identifier in the knock message corresponding to the multiple fragments based on the TCP knock private protocol. Specifically, according to the aforementioned TCP knock private protocol description, the TCP knock private protocol header is prefixed, and the first record, middle record and tail record are spliced.

[0055] The client sends the knock message to the server.

[0056] The server distinguishes the first record, the middle record, the last record and the fragments in the middle record according to the first identifier in the received knock message, and splices the first record, the middle record and the last record into complete user identity authentication information according to the first identifier, decrypts the spliced ​​user identity authentication information and verifies it with the user identity authentication information sent by the client.

[0057] If the verification is passed, the server opens the service port. If the verification is not passed, the data message is discarded. The service port is the port for business data transmission between the client and the server.

[0058] It should be noted that, when the client is an SDP client, the server may specifically be a knock authentication server such as an SDP gateway.

[0059] The TCP-based knocking authentication method provided in the embodiment of the present application can fragment multiple TCP knocking messages carrying user identity authentication information fragments, send them sequentially to the server, and finally splice them into complete user identity authentication information to realize the authentication function, avoid the possible restrictions of UDP messages on the Internet, and improve the success rate of knocking authentication in single-packet authentication applications.

[0060] Furthermore, in one embodiment, before sending the knock message to the server, the method may further specifically include:

[0061] The knock message is sent according to the sequential transmission order of the first data, the second data and the third data, and the order of the multiple fragments in the second data is randomly disrupted.

[0062] Optionally, the client sends the knock message in the order of transmission of the first data (first record), the second data (middle record) and the third data (tail record). Specifically, the client keeps the sending order of the generated first record and tail record unchanged, randomly shuffles the sending order of each fragment in the middle record, and generates a linked list to be sent in the order of the first record, the shuffled middle record and the tail record.

[0063] The client sends the first record, the middle record and the last record to the server in sequence according to the linked list to be sent.

[0064] The TCP-based knock authentication method provided in the embodiment of the present application randomly sends knock messages generated based on the fragments corresponding to the user identity authentication information to the server, such as the SDP gateway, in a disordered order. The SDP gateway splices the knock messages in order, verifies the spliced ​​user identity authentication information and the user identity authentication information sent by the client, and opens the service port if it is legal, and discards the data message if it is illegal. Compared with the current mainstream single-packet authentication technology, the TCP protocol has better adaptability in the Internet environment, and the random and disordered knock messages improve the security protection capability, which has greater security and network adaptability advantages than the existing mainstream single-packet authentication method.

[0065] Furthermore, in one embodiment, the encrypted user identity authentication information is obtained by encrypting the user identity authentication information based on an encryption algorithm.

[0066] Optionally, the encrypted user identity authentication information can be obtained by encrypting the user identity authentication information by the client based on an encryption algorithm. The user identity authentication information can specifically include a user name, a password (used to determine whether the user is legitimate), a terminal identification code (the user determines the terminal used by the user), a terminal network environment (used to determine the network environment of the terminal used by the user), clock information, and a randomly generated random number. The encryption algorithm can specifically adopt a symmetric encryption algorithm or an asymmetric encryption algorithm, such as a key-based message authentication code algorithm (Hash-based Message Authentication Code, HMAC) encryption algorithm. Since a random number is added to the user identity authentication information, encryption and obfuscation of the user identity authentication information can be achieved based on the encryption algorithm, further ensuring the transmission security of the user authentication information.

[0067] Figure 5 This is the second flow chart of the TCP-based knocking authentication method provided in the embodiment of the present application. Figure 5 The TCP-based knocking authentication method provided in the embodiment of the present application may specifically include:

[0068] Step 210, receiving a knock message sent by the client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, and the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0069] Step 220: splice the knock message according to the first identifier and verify the user identity authentication information.

[0070] It should be noted that the execution subject of the above method can be specifically a server, more specifically a knock authentication server, such as an SDP gateway.

[0071] Optionally, the server receives a knock message sent by the client, where the knock message may be specifically obtained by the client splitting the encrypted user identity authentication information into multiple segments and generating knock messages corresponding to the multiple segments based on the TCP knock private protocol.

[0072] The knock message can be specifically a data message (such as a SYN message, i.e., a Synchronize message in TCP) obtained by processing multiple fragments corresponding to the encrypted user authentication information based on the TCP knock private protocol in this application. For example, the multiple fragments corresponding to the encrypted user authentication information are carried in the optional custom field in the TCP SYN message, and encapsulated through the TCP knock private protocol. According to the optional character length requirement, the encrypted user authentication information is split into N fragments with a maximum of no more than 35 bytes. The data message includes a first record, a middle record, and a tail record.

[0073] Among them, the first record, the middle record and the tail record correspond to the first data, the second data and the third data respectively. The first data carries the sum of the lengths of each segment of a knock batch, and carries the sending time of the knock message (for example, it can be the timestamp of sending the knock message), without carrying any segments. For details, refer to Figure 2 The second data does not carry the sum of the lengths of the individual segments (length), nor does it carry the sending time of the knock message. Instead, it carries the individual segments of the encrypted user identity authentication information. Figure 3 The third data carries the sending time of the knock message, for details, refer to Figure 4The knock message also includes a first identifier, which can be specifically used to distinguish the first data, the second data, the third data, and each fragment of the third data. For example, the first identifier can be a serial number, starting from 0, representing the first data, and increasing in sequence, not exceeding 255; the first identifier can also be distinguished by using different pictures or text information, which is not specifically limited in this application.

[0074] Reference Figure 2-Figure 4 , using a custom knock protocol header to save and merge segmented user authentication information, where the fields in the TCP knock private protocol are described as follows:

[0075] knock_id: 30 bits in length, indicating the ID of a batch knock request from the client. A batch knock request includes the first record, middle record, and tail record.

[0076] The first field, field T: whether it is the tail record. If this bit is filled with 1, it means it is the tail record.

[0077] The second field R field: whether to trigger the server to return a response message ACK or a connection reset message RST. If this bit is 1, it means that the server is triggered to return ACK or RST.

[0078] The T / R field mainly solves the problem of excessive pressure on the knocking server caused by repeated retransmission of knocking messages due to TCP's automatic retransmission mechanism. If this bit is filled with 1, the server can construct an ACK or RST message to return to the client to prevent the client from repeatedly retransmitting knocking messages. This function may cause the knocking server to leak the IP address, which may cause the risk of SYN flood attacks. It needs to be configured according to the actual application scenario.

[0079] sequence: sequence number, starting from 0, indicating the first record, and increasing in sequence, not exceeding 255.

[0080] length: The sum of the lengths of all data fragments, which is only carried in the first record.

[0081] timestamp: Timestamp. This field is mainly used to prevent replay attacks. A knock message that is too early or later than the current time is considered an illegal request.

[0082] piece: Each fragment corresponding to the encrypted user authentication information.

[0083] The client splits the encrypted user authentication information into multiple fragments, and generates the first record, middle record, tail record and first identifier in the knock message corresponding to the multiple fragments based on the TCP knock private protocol. Specifically, according to the aforementioned TCP knock private protocol description, the TCP knock private protocol header is prefixed, and the first record, middle record and tail record are spliced.

[0084] The server distinguishes the first record, the middle record, the last record and each fragment in the middle record according to the first identifier in the knock message sent by the client, and splices the first record, the middle record and the last record into complete user identity authentication information according to the first identifier, decrypts the spliced ​​user identity authentication information and verifies it with the user identity authentication information sent by the client.

[0085] If the verification is passed, the server opens the service port. If the verification is not passed, the data message is discarded. The service port is the port for business data transmission between the client and the server.

[0086] It should be noted that, when the client is an SDP client, the server may specifically be a knock authentication server such as an SDP gateway.

[0087] The TCP-based knocking authentication method provided in the embodiment of the present application can fragment multiple TCP knocking messages carrying user identity authentication information fragments, send them sequentially to the server, and finally splice them into complete user identity authentication information to realize the authentication function, avoid the possible restrictions of UDP messages on the Internet, and improve the success rate of knocking authentication in single-packet authentication applications.

[0088] Furthermore, in one embodiment, after receiving the knock message sent by the client, the method may further specifically include:

[0089] determining, according to a first field in the knock message, whether the client has completed sending the knock message, wherein the first field is used to indicate whether the third data is received;

[0090] According to the second field in the knock message, it is determined whether to send a response message or a connection reset message to the client.

[0091] Optionally, the server determines whether the client has completed sending the knock message based on the value of the first field (T field) in the knock message received from the client. If the T field in the knock message received by the server is 1, it means that the client has completed sending the third data in the knock message.

[0092] The server determines whether to send an ACK response message or an RCT connection reset message to the client based on the value of the second field (R field) in the knock message received from the client. If the value of the R field is 1, the server determines to send an ACK response message or an RST connection reset message to the client.

[0093] The TCP-based knocking authentication method provided in the embodiment of the present application is based on the T field and R field constructed in the knocking message. The T field is used to indicate whether it is the last batch of messages, and the R field is used to trigger whether the server returns an ACK response message or an RST connection reset message, so as to prevent excessive server pressure caused by repeated retransmission of the client's knocking message.

[0094] Furthermore, in one embodiment, after splicing the knock message according to the first identifier and verifying the user identity authentication information, the method may further specifically include:

[0095] When it is determined that the user identity authentication information passes the verification, the service port is opened, and the service data sent by the client through the service port is received.

[0096] Optionally, when determining that the user identity authentication information passes the verification, the server determines that the knock authentication is legal, opens a service port, and receives service data sent by the client based on the service port.

[0097] When the server determines that the user identity authentication information fails to pass the verification, it discards the knock message sent by the client.

[0098] Figure 6 This is a flow chart of the TCP knocking authentication connection provided by the embodiment of the present application, refer to Figure 6 ,include:

[0099] Step 1) The SDP client encrypts the user authentication information, including the user name / password, terminal hardware identification code, terminal network environment, clock, random number, etc., using the HMAC encryption algorithm, splits it into N fragments with a maximum length of no more than 35 bytes, and prefixes the TCP knock private protocol header according to the aforementioned TCP knock private protocol description, and splices the first record, middle record, and tail record;

[0100] Step 2) The SDP client keeps the first and last records generated in step 1 unchanged, randomly shuffles the order of the middle records, and generates a linked list to be sent in a new order;

[0101] Step 3) The client sends the to-be-sent linked list generated in step 2 to the server and SDP gateway in sequence;

[0102] Step 4) The SDP gateway decrypts the knock message sent in step 3, and combines the decrypted knock message into complete user identity authentication information according to the sequence field and the T field. After decryption, the verification is performed. If it passes, the service port is opened;

[0103] Step 5) The client initiates business data transmission.

[0104] The TCP-based knocking authentication method provided in the embodiment of the present application randomly sends the authentication information fragments to the SDP gateway in a disordered order. The SDP knocking server merges and verifies the authentication information in the order after decryption. If it is legal, the service port is opened, and if it is illegal, the data message is discarded. Compared with the current mainstream single-packet authentication technology, the TCP protocol has better adaptability in the Internet environment. The random and disordered knocking message fragments improve the security protection capability. It has greater security and network adaptation advantages than the existing mainstream single-packet authentication method, and meets the needs of safe and efficient transmission of user identity authentication information.

[0105] The following is a description of a TCP-based knock authentication device provided in an embodiment of the present application. The TCP-based knock authentication device described below and the TCP-based knock authentication method described above can refer to each other.

[0106] Figure 7 This is one of the structural diagrams of the TCP-based knock authentication device provided in the embodiment of the present application. Figure 7 The TCP-based knock authentication device provided in the embodiment of the present application may specifically include:

[0107] A first sending module 710 is used to split the encrypted user identity authentication information into multiple fragments, and generate knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, the first data carries the sum of the lengths of each fragment and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0108] The second sending module 711 is used to send the knock message to the server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

[0109] The TCP-based knock authentication device provided in the embodiment of the present application can fragment multiple TCP knock messages carrying user identity authentication information fragments, send them sequentially to the server, and finally splice them into complete user identity authentication information to realize the authentication function, avoid the possible restrictions of UDP messages on the Internet, and improve the success rate of knock authentication in single-packet authentication applications.

[0110] Figure 8 This is the second structural diagram of the TCP-based knock authentication device provided in the embodiment of the present application. Figure 8 The TCP-based knock authentication device provided in the embodiment of the present application may specifically include:

[0111] The first receiving module 810 is used to receive a knock message sent by a client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, and the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0112] The second receiving module 811 is used to splice the knock message according to the first identifier and verify the user identity authentication information.

[0113] The TCP-based knock authentication device provided in the embodiment of the present application can fragment multiple TCP knock messages carrying user identity authentication information fragments, send them sequentially to the server, and finally splice them into complete user identity authentication information to realize the authentication function, avoid the possible restrictions of UDP messages on the Internet, and improve the success rate of knock authentication in single-packet authentication applications.

[0114] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call a computer program in the memory 930 to execute the steps of the TCP-based knocking authentication method, for example, including:

[0115] Split the encrypted user identity authentication information into multiple fragments, and generate knock messages corresponding to the multiple fragments based on the transmission control protocol TCP, the knock message at least includes first data, second data, third data and a first identifier, the first data carries the sum of the lengths of each fragment and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0116] The knock message is sent to a server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

[0117] or,

[0118] Receive a knock message sent by a client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0119] The knock message is spliced ​​according to the first identifier, and the user identity authentication information is verified.

[0120] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0121] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the TCP-based knocking authentication method provided in the above embodiments, for example, including:

[0122] Split the encrypted user identity authentication information into multiple fragments, and generate knock messages corresponding to the multiple fragments based on the transmission control protocol TCP, the knock message at least includes first data, second data, third data and a first identifier, the first data carries the sum of the lengths of each fragment and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0123] The knock message is sent to a server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

[0124] or,

[0125] Receive a knock message sent by a client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0126] The knock message is spliced ​​according to the first identifier, and the user identity authentication information is verified.

[0127] On the other hand, an embodiment of the present application further provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, wherein the computer program is used to enable the processor to execute the steps of the methods provided in the above embodiments, for example, including:

[0128] Split the encrypted user identity authentication information into multiple fragments, and generate knock messages corresponding to the multiple fragments based on the transmission control protocol TCP, the knock message at least includes first data, second data, third data and a first identifier, the first data carries the sum of the lengths of each fragment and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0129] The knock message is sent to a server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

[0130] or,

[0131] Receive a knock message sent by a client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments;

[0132] The knock message is spliced ​​according to the first identifier, and the user identity authentication information is verified.

[0133] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0134] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution 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 ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A TCP-based knocking authentication method, characterized in that: include: Split the encrypted user identity authentication information into multiple fragments, and generate knock messages corresponding to the multiple fragments based on the transmission control protocol TCP, the knock message at least includes first data, second data, third data and a first identifier, the first data carries the sum of the lengths of each fragment and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments; The knock message is sent to a server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

2. The TCP-based knocking authentication method according to claim 1, characterized in that: Before sending the knock message to the server, the method further includes: The knock message is sent according to the sequential transmission order of the first data, the second data and the third data, and the order of the multiple fragments in the second data is randomly disrupted.

3. The TCP-based knocking authentication method according to claim 1, characterized in that: The encrypted user identity authentication information is obtained by encrypting the user identity authentication information based on an encryption algorithm.

4. A TCP-based knocking authentication method, characterized in that: include: Receive a knock message sent by a client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments; The knock message is spliced ​​according to the first identifier, and the user identity authentication information is verified.

5. The TCP-based knocking authentication method according to claim 4, characterized in that: After receiving the knock message sent by the client, the method further includes: determining, according to a first field in the knock message, whether the client has completed sending the knock message, wherein the first field is used to indicate whether the third data is received; According to the second field in the knock message, it is determined whether to send a response message or a connection reset message to the client.

6. The TCP-based knocking authentication method according to claim 4, characterized in that: After splicing the knock message according to the first identifier and verifying the user identity authentication information, the method further includes: When it is determined that the user identity authentication information passes the verification, the service port is opened, and the service data sent by the client through the service port is received.

7. A TCP-based knock authentication device, characterized in that: include: a first sending module, configured to split the encrypted user identity authentication information into multiple fragments, and generate knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments; The second sending module is used to send the knock message to the server, so that the server splices the knock message according to the first identifier and verifies the user identity authentication information.

8. A TCP-based knock authentication device, characterized in that: include: A first receiving module is used to receive a knock message sent by a client, wherein the knock message is generated by the client by splitting the encrypted user identity authentication information into multiple fragments and generating the knock messages corresponding to the multiple fragments based on TCP, wherein the knock message includes at least first data, second data, third data and a first identifier, wherein the first data carries the sum of the lengths of the fragments and the sending time of the knock message, the second data carries the multiple fragments, and the third data carries the sending time of the knock message, and the first identifier is used to distinguish the first data, the second data, the third data and the multiple fragments; The second receiving module is used to splice the knock message according to the first identifier and verify the user identity authentication information.

9. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the TCP-based knock authentication method according to any one of claims 1 to 3 is implemented, or the TCP-based knock authentication method according to any one of claims 4 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the TCP-based knocking authentication method according to any one of claims 1 to 3 is implemented, or the TCP-based knocking authentication method according to any one of claims 4 to 6 is implemented.

Citation Information

Cited By

  • Dynamic multi-port knocking network service access method and system

    CN119583114A