Single-package authentication method and system based on device fingerprint enhanced verification
A two-step authentication method using SPA and device fingerprint verification addresses the security risk of IP address conversion in NAT scenarios by validating each client's identity, preventing unauthorized access.
Patent Information
- Application Number
- CN202411116603.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-14
AI Technical Summary
Existing single-packet authentication (SPA) methods fail to account for network address translation (NAT) scenarios, allowing clients with converted IP addresses to bypass authentication and access services, posing a security risk.
Implement a two-step authentication process involving preliminary SPA authentication followed by device fingerprint verification using unique device fingerprint information, ensuring each client's identity is validated through a client identifier (UID) and device fingerprint information.
This approach prevents authentication amplification due to NAT address conversion, enhancing security by ensuring only legitimate clients with valid device fingerprints can access services.
Smart Images

Figure CN118646606B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the Internet of Things, and in particular to a single packet authentication (SPA: Single Packet Authorization) method and system based on device fingerprint enhanced verification. Background Art
[0002] Any terminal that wants to access a server in a network stealth environment must go through SPA. SPA is the basis for the software-defined perimeter (SDP) network to achieve network stealth. However, the existing SPA does not take into account the situation where network address translation (NAT) exists at the LAN egress. In the NAT scenario, the IP address of the client to be authenticated will be converted to the same source IP address. Based on this, as long as one client single-packet authentication succeeds, other clients associated with the client (the IP addresses of other clients and the IP address of the client that successfully authenticated the single-packet authentication are converted to the same source IP address) can bypass authentication and access services, which poses a great security risk. Summary of the invention
[0003] The embodiments of the present application provide a single-packet authentication method and system based on device fingerprint enhanced verification to avoid the risk of a client bypassing authentication and accessing services in a NAT scenario.
[0004] The embodiment of the present application provides a single-packet authentication SPA method based on device fingerprint enhanced verification, which is applied to a server and includes:
[0005] Authenticate the SPA authentication package sent by the client;
[0006] If the SPA authentication package passes the authentication, an authentication success message is sent to the client to instruct the client to return the device fingerprint information of the client through the authentication success message; the authentication success message carries the client identifier UID currently assigned by the server to the client;
[0007] Receiving device fingerprint information returned by the client; the device fingerprint information returned by the client is generated by the client based on the client identifier UID;
[0008] The device fingerprint information returned by the client is authenticated, and if the device fingerprint information passes the authentication, it is determined that the client passes the authentication.
[0009] The embodiment of the present application also provides a single-packet authentication SPA method based on device fingerprint enhanced verification, which is applied to a client and includes:
[0010] Before accessing the port or service managed by the server, send the SPA authentication package to the server for single packet authentication;
[0011] Receiving an authentication success message returned by the server after the SPA authentication package passes authentication; the authentication success message instructs the client to return the device fingerprint information of the client; the authentication success message carries the client identifier UID currently assigned by the server to the client;
[0012] Generate device fingerprint information of the client based on the client identifier UID, and send the device fingerprint information to the server;
[0013] After the device fingerprint information returned by the client passes the authentication of the server, the port or service managed by the server is accessed.
[0014] The embodiment of the present application also provides a single-package authentication SPA system based on device fingerprint enhanced verification, the system comprising a server and a client;
[0015] The server executes the steps in the first method above;
[0016] The client executes the steps in the second method as above.
[0017] The embodiment of the present application also provides a single-packet authentication SPA device based on device fingerprint enhanced verification, which is applied to a server, and includes:
[0018] The SPA authentication package verification module is used to perform single-package authentication on the SPA authentication package sent by the client; if the SPA authentication package passes the authentication, an authentication success message is sent to the client to instruct the client to return the device fingerprint information of the client through the authentication success message; the authentication success message carries the client identifier UID currently assigned by the server to the client;
[0019] The fingerprint verification module is used to receive the device fingerprint information returned by the client; the device fingerprint information returned by the client is generated by the client based on the client identifier UID; the device fingerprint information returned by the client is authenticated, and if the device fingerprint information passes the authentication, it is determined that the client passes the authentication.
[0020] The embodiment of the present application also provides a single-packet authentication SPA device based on device fingerprint enhanced verification, the device is applied to a client, and the device includes:
[0021] SPA authentication package sending module, used to send SPA authentication package to the server for single packet authentication before accessing the port or service managed by the server;
[0022] A fingerprint sending module is used to receive an authentication success message returned by the server after the SPA authentication package passes authentication; the authentication success message instructs the client to return the device fingerprint information of the client; the authentication success message carries the client identifier UID currently assigned by the server to the client; the device fingerprint information of the client is generated based on the client identifier UID, and the device fingerprint information is sent to the server.
[0023] It can be seen from the above technical solutions that this embodiment first authenticates the SPA authentication package (equivalent to preliminary authentication), and then uses the unique device fingerprint information for further enhanced verification. The entire SPA authentication package authentication is completed through these two steps. This can solve the authentication amplification problem caused by NAT address conversion, and avoid the risk that as long as one client single package authentication succeeds, other clients associated with the client (the IP addresses of other clients and the IP address of the client that succeeded in the single package authentication are converted to the same source IP address) can bypass authentication and access services. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.
[0025] Figure 1 A flow chart of the method provided in the embodiment of the present application;
[0026] Figure 2 A schematic diagram of synchronization operation provided in an embodiment of the present application;
[0027] Figure 3 A flowchart for generating a SPA authentication package provided in an embodiment of the present application;
[0028] Figure 4 SPA authentication package authentication flow chart provided for the embodiment of the present application;
[0029] Figure 5 A TOTP key verification flow chart provided for an embodiment of the present application;
[0030] Figure 6 A complete flow chart provided for the embodiments of the present application;
[0031] Figure 7 Another flow chart provided for an embodiment of the present application;
[0032] Figure 8 A structural diagram of a device provided in an embodiment of the present application;
[0033] Fig. 9Another device structure diagram provided for an embodiment of the present application;
[0034] Fig.10 A system structure diagram provided for an embodiment of the present application;
[0035] Fig.11 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0037] Please refer to Figure 1 , Figure 1 The method flow chart provided for the embodiment of the present application is as follows. As an embodiment, the method is applied to the server.
[0038] like Figure 1 As shown, the method may include the following steps:
[0039] Step 101: Authenticate the SPA authentication package sent by the client.
[0040] In a specific application, when the client needs to access the port associated with the server or the service managed by the server, the client will first send a SPA authentication package to the server to initiate authentication.
[0041] When the server receives the SPA authentication package, it will authenticate the SPA authentication package. The authentication here is equivalent to the preliminary authentication of the SPA authentication package.
[0042] As for how to authenticate the SPA authentication package (i.e., preliminary authentication), the following will give an example and will not be described here.
[0043] Step 102: If the SPA authentication package passes the authentication, an authentication success message is sent to the client to instruct the client to return the client's device fingerprint information through the authentication success message; the authentication success message carries the client identifier (UID) currently assigned by the server to the client.
[0044] As an embodiment, the server may randomly and dynamically assign a unique UID to the client, and the UID is used by the client to generate device fingerprint information of the client.
[0045] Step 103, receiving the device fingerprint information returned by the client; the device fingerprint information returned by the client is generated by the client based on the client identifier UID.
[0046] As an embodiment, the device fingerprint information returned by the client is composed of the client identifier UID and the client information that has been synchronized from the client to the server.
[0047] Optionally, the client information includes at least: an IP address and a MAC address.
[0048] Taking the client information including IP address and MAC address as an example, the device fingerprint information here can be: IP:MAC:UID.
[0049] Step 104: authenticate the device fingerprint information returned by the client. If the device fingerprint information passes the authentication, it is determined that the client passes the authentication.
[0050] In this embodiment, after the server randomly and dynamically assigns a unique UID to the client, it will also record the UID, and record the UID and the client information that has been synchronized to the server to form device fingerprint information such as IP:MAC:UID into the fingerprint library. Based on this, in this step 104, authenticating the device fingerprint information returned by the client includes: checking whether there is target device fingerprint information matching the device fingerprint information returned by the client in the fingerprint library, if so, determining that the device fingerprint information has passed the authentication, otherwise, determining that the device fingerprint information has not passed the authentication.
[0051] As an embodiment, here, checking whether there is target device fingerprint information in the fingerprint library that matches the device fingerprint information returned by the client may include: checking whether there is target device fingerprint information in the fingerprint library that is the same as the device fingerprint information returned by the client, or checking whether there is target device fingerprint information in the fingerprint library that meets a set similarity requirement with the device fingerprint information returned by the client. The set similarity requirement here is, for example, that the similarity is greater than or equal to a set similarity threshold (such as 50%).
[0052] As an embodiment, generally, when any client accesses a local area network as a legitimate device recognized by a server, the client information such as an IP address and a MAC address will be synchronized to the server.
[0053] It can be seen from the above steps 101 to 104 that the authentication of the SPA authentication package of the client in this embodiment is not limited to the authentication of the SPA authentication package itself. It first authenticates the SPA authentication package (equivalent to preliminary authentication), and then uses the unique device fingerprint information for further enhanced verification. The entire SPA authentication package authentication is completed through these two steps. The use of unique device fingerprint information for further enhanced verification can solve the authentication amplification problem caused by NAT address conversion, and avoid the risk that as long as one client single package authentication succeeds, other clients associated with the client (the IP addresses of other clients and the IP address of the client that successfully authenticated the single package are converted to the same source IP address) can bypass authentication and access services.
[0054] So far, completed Figure 1 The process shown.
[0055] pass Figure 1 It can be seen from the process shown that this embodiment first authenticates the SPA authentication package (equivalent to preliminary authentication), and then uses the unique device fingerprint information for further enhanced verification. The entire SPA authentication package authentication is completed through these two steps. This can solve the authentication amplification problem caused by NAT address translation, and avoid the risk that as long as one client single package authentication succeeds, other clients associated with the client (the IP addresses of other clients and the IP address of the client that successfully authenticated the single package are converted to the same source IP address) can bypass authentication and access services.
[0056] It should be noted that, in this embodiment, the server and the client use the User Datagram Protocol (UDP) protocol for data communication to improve authentication efficiency and reduce bandwidth consumption. Based on this, the above SPA authentication packet is a UDP packet generated according to UDP.
[0057] Based on the characteristics of UDP, the above authentication success message can carry the identifier of the specified first UDP port, such as an IP address, so that the device fingerprint information returned by the client is received through the first UDP port. Here, the first UDP port is different from the second UDP port where the server receives the SPA authentication packet. By dynamically replacing the port, data security can be guaranteed.
[0058] Based on this, the format of the above authentication success message can be shown in Table 1:
[0059] Table 1
[0060]
[0061] Compared with the existing TCP-based SPA authentication package for single-packet authentication, the UDP-based single-packet authentication provided in the embodiment of the present application does not need to open multiple ports for the three-way handshake process like TCP, and cannot achieve true port invisibility. The UDP-based single-packet authentication provided in this embodiment has fewer open UDP ports, higher security, and is more suitable for scenarios with frequent authentication between the server and the client.
[0062] As an embodiment, the SPA authentication package carries authentication credentials. The authenticating the SPA authentication package sent by the client may specifically be authenticating the authentication credentials carried by the SPA authentication package sent by the client.
[0063] Optionally, in this embodiment, the authentication credential may include an authentication key. As an embodiment, the authentication key may be generated according to a time-based one-time password (TOTP: Time-Based One-Time Password), that is, the authentication key may be a TOTP key.
[0064] To facilitate the generation of TOTP keys, before the method provided in this embodiment, the following steps may be performed: Figure 2 The synchronous operation shown:
[0065] See also Figure 2 , Figure 2 This is a schematic diagram of the synchronization operation provided by the embodiment of the present application. Figure 2 As shown, a SPA controller is deployed between the client and the server. As an embodiment, the SPA controller controls the server and the client to synchronize time to ensure that the two are highly synchronized in time. In addition, the SPA controller also publishes a private key shared by the server and the client to the server and the client to generate a TOTP key.
[0066] As an embodiment, when the SPA controller detects that the client initiates authentication, it controls the server and the client to perform time synchronization and synchronizes the private key to the server and the client.
[0067] Based on the above description, the SPA authentication package sent by the client is described below:
[0068] See also Figure 3 , Figure 3 The SPA authentication package generation flow chart provided in the embodiment of the present application is applied to the client. Figure 3 As shown, the process may include the following steps:
[0069] Step 301: Calculate a first TOTP key based on the TOTP algorithm.
[0070] In the specific implementation of step 301, a time counter (TC) may be calculated first, and then a first TOTP key may be calculated based on the TC and the above private key using the TOTP algorithm.
[0071] As an example, if the network status between the client and the server is good (for example, the network delay is less than or equal to the set delay, in which case the delay can be considered negligible), TC can be expressed by the following formula: TC = int(unixtimestamp(now) − unixtimestamp(T0)). int represents rounding operation. unixtimestamp(now) represents the current unix timestamp, and unixtimestamp(T0) represents the unix timestamp of the starting time point agreed upon by the client and the server. The default value is 0, that is, 0:0:00 on January 1, 1970.
[0072] As another embodiment, taking into account the possible network fluctuations between the client and the server and the delay caused by the transmission distance, this embodiment will first determine the allowed time difference (TD, also known as the delay time shared by the server and the client) between the client and the server based on the delay. Optionally, the TD can be determined based on experience or multiple attempts, for example, set to 10s. Based on the TD, it means that the TOTP keys calculated based on the TOTP algorithm at each timestamp within the time difference of TD on the client and the server are the same. Based on TD, the TC at this time can be expressed by the following formula: TC = int(((unixtimestamp(now) − unixtimestamp(T0))-TD) / TD).
[0073] If unixtimestamp(T0) defaults to 0, the above formula can be simplified to: TC = int((unixtimestamp(now)-TD) / TD).
[0074] As an embodiment, there are multiple implementation methods for calculating the first TOTP key based on TC and the private key using the TOTP algorithm. For example, the first TOTP key is represented by the following formula: first TOTP key = HASH(SecretKey, TC). HASH represents a hash algorithm, which defaults to SHA-256. SecretKey represents the private key. Finally, the first TOTP key is calculated based on the TOTP algorithm in step 301.
[0075] Step 302: Pack the first TOTP key and the current timestamp together into a SPA authentication packet in UDP format, and send it to the second UDP port of the server.
[0076] That is, the authentication credentials carried in the above SPA authentication package may include: a first TOTP key and a current timestamp (recorded as a sending timestamp).
[0077] So far, completed Figure 3 The process shown.
[0078] pass Figure 3 The process shown implements the client sending the SPA authentication package to the server.
[0079] Based on the TOTP algorithm described above, it can be found that compared with the conventional one-time password encrypted based on the HMAC algorithm (HOTP: HMAC-Based One-Time Password), this embodiment no longer relies on synchronized TCs, thereby avoiding single-packet authentication failure when the TCs between the client and the server are not synchronized.
[0080] The following describes how the server authenticates the SPA authentication package sent by the client:
[0081] See also Figure 4 , Figure 4 This is a flowchart of the SPA authentication package authentication provided in the embodiment of the present application. This process is applied to the server.
[0082] Based on the above-mentioned SPA authentication package, the authentication credentials include the sending timestamp and the first TOTP key. Figure 4 As shown, the process may include the following steps:
[0083] Step 401, determine whether the time difference between the current timestamp and the sending timestamp carried by the SPA authentication packet is less than or equal to the set duration, if yes, execute step 402, if not, execute step 403.
[0084] The current timestamp here may be the timestamp when the server receives the SPA authentication package.
[0085] As an embodiment, the set duration here is determined based on the network delay between the server and the client. For example, the set duration can be the above-mentioned TD, such as 10s.
[0086] Step 402: determine that the SPA authentication package fails the authentication, discard the SPA authentication package, and end the authentication of the client.
[0087] This step 402 is performed under the premise that the time difference between the current timestamp and the sending timestamp carried by the SPA authentication package is greater than the set time. If the time difference between the current timestamp and the sending timestamp carried by the SPA authentication package is greater than the set time, it means that the SPA authentication package has expired. At this time, it can be considered that the SPA authentication package has not passed the authentication. The server directly discards the SPA authentication package and ends the authentication.
[0088] Step 403, verify the first TOTP key carried in the SPA authentication package. If the verification passes, it is determined that the SPA authentication package passes the authentication. Otherwise, it is determined that the SPA authentication package fails the authentication.
[0089] As an example, Figure 5 As shown, verifying the first TOTP key carried by the SPA authentication package may include the following steps:
[0090] Step 501 , checking whether there is a target TOTP key matching the first TOTP key in the TOTP key library, if yes, executing step 502 , if not, executing step 503 .
[0091] As an embodiment, checking whether there is a target TOTP key matching the first TOTP key in the TOTP key library may be, for example, checking whether there is a target TOTP key identical to the first TOTP key in the TOTP key library, or checking whether there is a target TOTP key in the TOTP key library whose similarity to the first TOTP key meets a set similarity requirement. The set similarity requirement here, for example, the similarity is greater than or equal to a set similarity threshold such as 50%, is not specifically limited in this embodiment.
[0092] Step 502: determine that the first TOTP key fails verification, discard the SPA authentication packet, and end the authentication of the client.
[0093] This step 502 is performed under the premise that there is a target TOTP key matching the first TOTP key in the TOTP key library. If there is a target TOTP key matching the first TOTP key in the TOTP key library, it means that the SPA authentication package is sent repeatedly, and there is a risk of replay attack. At this time, it can be considered that the first TOTP key has not passed the authentication, and the server directly discards the SPA authentication package and ends the authentication.
[0094] Step 503, calculate the second TOTP key based on the above private key and according to the TOTP algorithm, compare the first TOTP key and the second TOTP key to see if they match, if they match, determine that the first TOTP key has passed the verification, if they do not match, determine that the first TOTP key has not passed the verification.
[0095] In this embodiment, the server generates the second TOTP key according to the above-mentioned method of generating the first TOTP key.
[0096] In this embodiment, the first TOTP key and the second TOTP key match means that the first TOTP key and the second TOTP key are the same, or the similarity between the first TOTP key and the second TOTP key meets the set similarity requirement. The set similarity requirement here is, for example, the similarity is greater than or equal to a set similarity threshold such as 50%, etc., which is not specifically limited in this embodiment.
[0097] Finally passed Figure 5 The process shown implements verification of the first TOTP key carried by the SPA authentication package.
[0098] As an embodiment, in the above step 403, after determining that the SPA authentication package passes the authentication, the first TOTP key may be further recorded in the TOTP key library to facilitate the subsequent authentication of the SPA authentication package.
[0099] So far, it is completed Figure 4 The process shown.
[0100] pass Figure 4 The process shown implements authentication of the SPA authentication package sent by the client.
[0101] Based on the above Figures 1 to 5 The process shown, Figure 6 An example is given to illustrate a complete process.
[0102] For example, Figure 6 As shown, in step 601, the server and the client synchronize the time and the above-mentioned private key under the control of the SPA controller. In step 602, the client synchronizes client information such as IP address and MAC address to the server. In step 603, the client sends an SPA authentication package to the server. In step 604, the server authenticates the SPA authentication package. If the SPA authentication package fails to pass the authentication, it determines and outputs the authentication failure. If the SPA authentication package passes the authentication, it sends an authentication success message to the client to instruct the client to return the client's device fingerprint information through the authentication success message. In step 605, the server authenticates the device fingerprint information returned by the client (that is, fingerprint enhanced authentication). If the device fingerprint information passes the authentication, it is determined that the client passes the authentication, otherwise, it is determined and outputs the authentication failure.
[0103] The following briefly describes the method provided in the embodiment of the present application from the perspective of the client.
[0104] See also Figure 7 , Figure 7 Another flow chart provided for an embodiment of the present application. The flow chart is applied to a client. Figure 7 The process shown corresponds to Figure 1 .like Figure 7 As shown, the process may include the following steps:
[0105] Step 701: before accessing the port or service managed by the server, the client sends a SPA authentication packet to the server for single packet authentication.
[0106] Step 702, the client receives an authentication success message returned by the server after the SPA authentication package passes the authentication; the authentication success message instructs the client to return the device fingerprint information of the client; the authentication success message carries the client identifier UID currently assigned by the server to the client.
[0107] Step 703: The client generates device fingerprint information of the client based on the client identifier UID, and sends the device fingerprint information to the server.
[0108] So far, completed Figure 7 The process shown.
[0109] The method provided in the embodiment of the present application is described above. The device and system provided in the embodiment of the present application are described below:
[0110] See also Figure 8 , Figure 8 This is a diagram of the structure of the device provided in the embodiment of the present application. Figure 1 The process shown is applied to the server. Figure 8 As shown, the device may include:
[0111] The SPA authentication package verification module is used to perform single-package authentication on the SPA authentication package sent by the client; if the SPA authentication package passes the authentication, an authentication success message is sent to the client to instruct the client to return the device fingerprint information of the client through the authentication success message; the authentication success message carries the client identifier UID currently assigned by the server to the client;
[0112] The fingerprint verification module is used to receive the device fingerprint information returned by the client; the device fingerprint information returned by the client is generated by the client based on the client identifier UID; the device fingerprint information returned by the client is authenticated, and if the device fingerprint information passes the authentication, it is determined that the client passes the authentication.
[0113] As an embodiment, the SPA authentication packet is a UDP packet generated according to the User Datagram Protocol UDP;
[0114] The authentication success message carries an identifier of a specified first UDP port; the first UDP port is different from a second UDP port used by the server to receive the SPA authentication packet;
[0115] The receiving the device fingerprint information returned by the client includes: receiving the device fingerprint information returned by the client through the first UDP port.
[0116] As an embodiment, the server performs time synchronization with the client under the control of the SPA controller; and receives a private key shared by the server and the client issued by the SPA controller;
[0117] The SPA authentication package carries a sending timestamp and a first TOTP key; the sending timestamp is the timestamp of the client sending the SPA authentication package; the first TOTP key is calculated by the client according to the private key and in accordance with a time-based one-time password TOTP algorithm;
[0118] The authenticating the SPA authentication package sent by the client includes: determining whether the time difference between the current timestamp and the sending timestamp carried by the SPA authentication package is less than or equal to the set duration; if not, determining that the SPA authentication package has not passed the authentication, discarding the SPA authentication package, and ending the authentication of the client; if yes, verifying the first TOTP key carried by the SPA authentication package; if it passes the verification, determining that the SPA authentication package has passed the authentication; otherwise, determining that the SPA authentication package has not passed the authentication.
[0119] As an embodiment, the verifying the first TOTP key carried by the SPA authentication package includes:
[0120] Check whether there is a target TOTP key matching the first TOTP key in the TOTP key library, if yes, determine that the SPA authentication package has not passed the authentication, discard the SPA authentication package, and end the authentication of the client; if no, calculate the second TOTP key according to the private key and the TOTP algorithm, compare whether the first TOTP key and the second TOTP key match, if they match, determine that the first TOTP key has passed the verification, if they do not match, determine that the first TOTP key has not passed the verification;
[0121] After determining that the SPA authentication package passes the authentication, the method further includes: recording the first TOTP key into the TOTP key library.
[0122] As an embodiment, the calculating the first TOTP key or the second TOTP key according to the private key and the TOTP algorithm includes:
[0123] Calculating a time counter TC based on a delay time shared by the server and the client, and a current timestamp; wherein the delay time is the same as or different from the set duration; and the delay time is determined based on a network delay between the server and the client;
[0124] The private key and the TC are calculated according to the TOTP algorithm to obtain a first TOTP key or a second TOTP key.
[0125] As an embodiment, the sending of the authentication success message to the client further includes: recording the device fingerprint information composed of the client identifier UID and the client information synchronized to the server by the client into a fingerprint database;
[0126] The authenticating the device fingerprint information returned by the client includes: checking whether there is target device fingerprint information matching the device fingerprint information returned by the client in the fingerprint library; if so, determining that the device fingerprint information has passed the authentication; otherwise, determining that the device fingerprint information has not passed the authentication.
[0127] As an embodiment, the device fingerprint information returned by the client is composed of the client identifier UID and the client information that has been synchronized from the client to the server;
[0128] The client information includes at least: IP address and MAC address.
[0129] So far, completed Figure 8 Structural description of the device shown.
[0130] See also Fig. 9 , Fig. 9 Another device structure diagram provided in an embodiment of the present application. The device is applied to a client and includes:
[0131] SPA authentication package sending module, used to send SPA authentication package to the server for single packet authentication before accessing the port or service managed by the server;
[0132] A fingerprint sending module is used to receive an authentication success message returned by the server after the SPA authentication package passes authentication; the authentication success message instructs the client to return the device fingerprint information of the client; the authentication success message carries the client identifier UID currently assigned by the server to the client; the device fingerprint information of the client is generated based on the client identifier UID, and the device fingerprint information is sent to the server.
[0133] Based on the above description, the present application embodiment also provides Fig.10 The system structure diagram shown in the figure. The system provided in the embodiment of the present application mainly includes the server and the client as described above. The server executes as Figure 1 The steps in the method shown; the client executes Figure 7 Steps in the method shown.
[0134] As an embodiment, the system further comprises: a SPA controller connected between the server and the client. The SPA controller is used to control the server to synchronize time with the client; and to publish a private key shared by the server and the client; wherein the server synchronizes time with the client, and the private key is used by the client and the server to generate a TOTP key according to a time-based one-time password TOTP algorithm; the TOTP key generated by the server is used to verify the TOTP key generated by the client.
[0135] So far, completed Fig.10 Structural description of the system shown.
[0136] The present application also provides Figure 8 or Fig. 9 The hardware structure of the device shown. Fig.11 , Fig.10 This is a structural diagram of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.
[0137] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.
[0138] Based on the same application concept as the above method, an embodiment of the present application further provides a computer program product, wherein the computer program product stores a computer program, and when the computer program is executed by a processor, the method disclosed in the above example of the present application is implemented.
[0139] Exemplarily, the above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device, which can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof.
[0140] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A single-package authentication SPA method based on device fingerprint enhanced verification, It is characterized in that The method is applied to the server, and the method comprises: Authenticate the SPA authentication package sent by the client; If the SPA authentication package passes the authentication, an authentication success message is sent to the client to instruct the client to return the device fingerprint information of the client through the authentication success message; the authentication success message carries the client identifier UID currently assigned to the client by the server; the authentication success message carries the identifier of the specified first UDP port; the first UDP port is different from the second UDP port where the server receives the SPA authentication package; receiving the device fingerprint information returned by the client through the first UDP port; the device fingerprint information returned by the client is generated by the client based on the client identifier UID; The device fingerprint information returned by the client is authenticated, and if the device fingerprint information passes the authentication, it is determined that the client passes the authentication.
2. The method according to claim 1, It is characterized in that The method further includes: performing time synchronization with the client under the control of the SPA controller; and receiving a private key shared by the server and the client issued by the SPA controller; The SPA authentication package carries a sending timestamp and a first TOTP key; the sending timestamp is a timestamp of the client sending the SPA authentication package; the first TOTP key is calculated by the client according to the private key and in accordance with a time-based one-time password TOTP algorithm; The authenticating the SPA authentication package sent by the client includes: determining whether the time difference between the current timestamp and the sending timestamp carried by the SPA authentication package is less than or equal to the set duration; if not, determining that the SPA authentication package has not passed the authentication, discarding the SPA authentication package, and ending the authentication of the client; if yes, verifying the first TOTP key carried by the SPA authentication package; if it passes the verification, determining that the SPA authentication package has passed the authentication; otherwise, determining that the SPA authentication package has not passed the authentication.
3. The method according to claim 2, It is characterized in that The verifying of the first TOTP key carried by the SPA authentication package includes: Check whether there is a target TOTP key matching the first TOTP key in the TOTP key library. If yes, determine that the first TOTP key fails to pass the verification, discard the SPA authentication package, and end the authentication of the client; if not, calculate the second TOTP key according to the private key and the TOTP algorithm, compare whether the first TOTP key and the second TOTP key match, if they match, determine that the first TOTP key passes the verification, and if they do not match, determine that the first TOTP key fails to pass the verification; After determining that the SPA authentication package passes the authentication, the method further includes: recording the first TOTP key into the TOTP key library.
4. The method according to claim 2 or 3, It is characterized in that The calculating the first TOTP key or the second TOTP key according to the private key and the TOTP algorithm includes: Calculating a time counter TC based on a delay time shared by the server and the client, and a current timestamp; wherein the delay time is the same as or different from the set duration; and the delay time is determined based on a network delay between the server and the client; The private key and the TC are calculated according to the TOTP algorithm to obtain a first TOTP key or a second TOTP key.
5. The method according to claim 1, It is characterized in that The sending of the authentication success message to the client further includes: recording the device fingerprint information composed of the client identifier UID and the client information synchronized to the server into a fingerprint database; The authenticating the device fingerprint information returned by the client includes: checking whether there is target device fingerprint information matching the device fingerprint information returned by the client in the fingerprint library; if so, determining that the device fingerprint information has passed the authentication; otherwise, determining that the device fingerprint information has not passed the authentication.
6. The method according to claim 5, It is characterized in that The device fingerprint information returned by the client is composed of the client identifier UID and the client information that has been synchronized from the client to the server; The client information includes at least: IP address and MAC address.
7. A single-packet authentication SPA method based on device fingerprint enhanced verification, It is characterized in that The method is applied to a client, and the method comprises: Before accessing the port or service managed by the server, send the SPA authentication package to the server for single packet authentication; Receive an authentication success message returned by the server after the SPA authentication package passes the authentication; the authentication success message instructs the client to return the device fingerprint information of the client; the authentication success message carries the client identifier UID currently assigned by the server to the client; the authentication success message carries the identifier of the specified first UDP port; the first UDP port is different from the second UDP port where the server receives the SPA authentication package; Generate device fingerprint information of the client based on the client identifier UID, and send the device fingerprint information to the server, so that the server receives the device fingerprint information returned by the client through the first UDP port; After the device fingerprint information returned by the client passes the authentication of the server, the port or service managed by the server is accessed.
8. A single-package authentication SPA system based on device fingerprint enhanced verification, It is characterized in that The system includes a server and a client; The server performs the steps in any method of claims 1 to 6; The client performs the steps in the method of claim 7.
9. The system according to claim 8, It is characterized in that The system further includes: a SPA controller connected between the server and the client; The SPA controller is used to control the server to synchronize time with the client; and to publish a private key shared by the server and the client; Among them, the server and the client perform time synchronization, and the private key is used by the client and the server to generate a TOTP key according to a time-based one-time password TOTP algorithm; the TOTP key generated by the server is used to verify the TOTP key generated by the client.
