A method, device and medium for security authentication of a PostgreSQL database
By introducing an authentication mechanism using user passwords, preset passwords, and auto-incrementing counters in the PostgreSQL database, and generating communication keys for authentication, the problem of unauthorized login caused by user password leakage is solved, achieving higher security and dynamism, preventing unauthorized login from different locations, and timely detection of abnormal behavior.
Patent Information
- Application Number
- CN202610802202.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-04
- Publication Date
- 2026-08-25
AI Technical Summary
Existing PostgreSQL database authentication methods rely on user passwords, which can lead to unauthorized and clandestine logins due to password leaks. Furthermore, the lack of effective monitoring and response mechanisms results in insufficient security.
A key derivation function is used to generate a communication key for authentication by using three sets of authentication data: user password, preset password, and auto-incrementing counter value. This ensures the dynamism and security of each authentication process, and the counter value is synchronized between the client and the server to prevent unauthorized login from different locations.
It improves the security of PostgreSQL databases, prevents unauthorized logins, promptly detects abnormal login behavior, reduces the risk of replay attacks, and enhances the dynamism and security of the authentication process.
Smart Images

Figure CN122634644A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of security authentication technology, and in particular to a method, device and medium for PostgreSQL database security authentication. Background Technology
[0002] With increasing awareness of data security and privacy protection, database security management has become increasingly important. PostgreSQL, as a widely used relational database management system, primarily relies on password authentication for its security strategy. However, this mechanism has some significant shortcomings. First, the security of user passwords is highly dependent on the user's own management awareness and practices. If not managed properly, user passwords may be obtained by attackers, leading to security risks. Furthermore, when user passwords are leaked, attackers can perform covert unauthorized logins and obtain sensitive data without causing any obvious damage. Due to the lack of traceable abnormal behavior, this situation may go undetected by monitoring systems and administrators in a timely manner, delaying response time and causing incalculable losses to the organization. Therefore, secure authentication for PostgreSQL databases is crucial.
[0003] Currently, authentication methods for PostgreSQL databases include two-factor authentication, third-party authentication, intrusion detection systems, and behavioral analysis techniques. While these methods each improve database security—for example, two-factor authentication requires users to provide additional verification besides a password, enhancing security to some extent—they still cannot completely solve the problem of unauthorized logins and clandestine logins caused by password leaks, resulting in a poor user experience for legitimate users. Summary of the Invention
[0004] To address the aforementioned technical problems, this specification provides one or more embodiments of a method, device, and medium for PostgreSQL database security authentication.
[0005] One or more embodiments of this specification employ the following technical solutions: This specification provides one or more embodiments of a method for PostgreSQL database security authentication, the method including: The client receives the username and password input by the user, and generates a first communication key by using the username, the password and local authentication data through a key derivation function; wherein, the local authentication data includes: a first preset password and a first count value; The server receives a username sent by the client and queries the PostgreSQL database to obtain the stored user password and authentication data corresponding to the username; wherein, the authentication data includes: a second preset password and a second counter value; The server generates a second communication key using the username, the stored user password, and the authentication data through a key derivation function. The server receives the first communication key and performs password authentication based on the first communication key and the second communication key to obtain the authentication result of the PostgreSQL database.
[0006] Optionally, in one or more embodiments of this specification, before the client receives a username and password input by the user to generate a first communication key by combining the username, the password, and local authentication data, the method further includes: The client receives the username and queries the username based on the client's local files to determine whether the username corresponds to a new user; If so, the server receives the second preset password corresponding to the username, generated based on the PostgreSQL database, and generates an initial count value corresponding to the username. The username, the corresponding second preset password, and the initial count value are saved to a local file on the client.
[0007] Optionally, in one or more embodiments of this specification, before the server receives a username sent by the client to query the PostgreSQL database to obtain the stored user password and authentication data corresponding to the username, the method further includes: The server receives user creation information, creates a new username corresponding to the new user based on the user creation information, and generates an initial count value corresponding to the username. In response to the user creation information, the PostgreSQL database generates a second preset password based on a random number and stores the second preset password and the initial count value in the database system table of the PostgreSQL database.
[0008] Optionally, in one or more embodiments of this specification, the username, the user password, and local authentication data are used to generate a first communication key through a key derivation function, specifically including: The client performs an XOR operation between the user password and the first preset password of the local authentication data to obtain the first key value; Obtain the key bit length generated based on the authentication security requirement information of the PostgreSQL database; The key bit length, the first key value, the first count value, and the index of the derived key are input into the key derivation function to output the first communication key according to the key derivation function; wherein, the index of the derived key is used to represent the key currently generated during the communication key generation process.
[0009] Optionally, in one or more embodiments of this specification, the server generates a second communication key from the username, the stored user password, and the authentication data using a key derivation function, specifically including: The server performs an XOR operation between the stored user password and the second preset password of the authentication data to obtain the second key value; Obtain the key bit length generated based on the authentication security requirement information of the PostgreSQL database; The key bit length, the second key value, the second count value, and the index of the derived key are input into the key derivation function to output the second communication key according to the key derivation function.
[0010] Optionally, in one or more embodiments of this specification, the server receives the first communication key to perform password authentication based on the first communication key and the second communication key, and obtains the authentication result of the PostgreSQL database, specifically including: The server receives the first communication key and compares it with the second communication key. If the first communication key matches the second communication key, then the authentication result of the PostgreSQL database is determined to be successful. If the first communication key is inconsistent with the second communication key, then the authentication result of the PostgreSQL database is determined to be authentication failure.
[0011] Optionally, in one or more embodiments of this specification, after the server receives the first communication key to perform password authentication based on the first communication key and the second communication key, and obtains the authentication result of the PostgreSQL database, the method further includes: If the authentication result of the PostgreSQL database is determined to be successful, the client and the server respectively increment the first count value and the second count value by a preset value; wherein, the preset value is 1; If the authentication result of the PostgreSQL database is determined to be authentication failure, neither the client nor the server will increment the first count value and the second count value by a preset value.
[0012] Optionally, in one or more embodiments of this specification, obtaining the key bit length generated based on the authentication security requirement information of the PostgreSQL database specifically includes: The server obtains the business scenario corresponding to the PostgreSQL database, and determines the evaluation time period for the key bit length based on the business update speed of the business scenario. Based on the aforementioned evaluation time period, the authentication security requirement information of the PostgreSQL database is received; Based on the matching relationship between the preset event trigger keywords and the authentication security requirement information, it is determined whether to trigger the key bit length update task; If so, the ideal adjustment length of the key bit length is determined based on the number of matching keywords of the preset event triggered by the update task. The additional storage amount of the communication key is determined based on the ideal adjustment length of the key bit length. Based on the remaining storage capacity of the PostgreSQL database and the additional storage capacity, it is determined whether the storage resources within the evaluation period meet the operating requirements of the PostgreSQL database. If so, the key bit length is adjusted based on the ideal adjustment length; If not, then the ideal adjustment length is decreased sequentially to adjust the key bit length.
[0013] This specification provides one or more embodiments of a device for PostgreSQL database security authentication, including: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described above.
[0014] This specification provides one or more embodiments of a non-volatile computer storage medium storing computer-executable instructions configured to perform any of the methods described above.
[0015] The above-described at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: By using three sets of authentication data—user password, pre-set password, and auto-incrementing counter—between the client and server in the PostgreSQL database authentication process, it no longer relies solely on the user password. Even if an attacker obtains the user password, the lack of a pre-set password and the correct counter prevents subsequent authentication from being completed, significantly increasing the difficulty for attackers to crack the authentication and effectively preventing unauthorized logins from different locations, thus improving overall security. Furthermore, the introduction of the counter adds a degree of dynamism to each authentication process. Even if an attacker intercepts authentication information from a particular instance, the counter will automatically increment, rendering the information invalid for the next authentication attempt. This allows for the timely detection of unauthorized users, further enhancing the authentication security of the PostgreSQL database. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 This is a schematic diagram of a PostgreSQL database security authentication method provided in the embodiments of this specification; Figure 2 This is a schematic diagram illustrating a client storing local authentication data, provided in an embodiment of this specification. Figure 3 This is a schematic diagram illustrating the storage of authentication data in a PostgreSQL database, as provided in an embodiment of this specification. Figure 4 This specification provides a schematic diagram of the overall process of PostgreSQL database security authentication as an embodiment. Figure 5 A schematic diagram of a device structure for PostgreSQL database security authentication provided in the embodiments of this specification; Figure 6 This is a schematic diagram of the structure of a non-volatile storage medium provided in the embodiments of this specification. Detailed Implementation
[0017] This specification provides a method, device, and medium for PostgreSQL database security authentication through its embodiments.
[0018] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0019] like Figure 1 As shown in the diagram, this specification provides a flowchart illustrating a method for PostgreSQL database security authentication. Figure 1 As can be seen from one or more embodiments of this specification, a method for PostgreSQL database security authentication includes the following steps: S101: The client receives the username and password input by the user, and generates a first communication key by using the username, the password and local authentication data through a key derivation function; wherein, the local authentication data includes: a first preset password and a first count value.
[0020] To provide an enhanced authentication method that effectively prevents unauthorized logins from different locations even if user passwords are compromised, and to promptly detect unauthorized login attempts from different locations, this specification's embodiments enhance the security of the conventional password authentication process by adding a fixed preset password and an auto-incrementing counter value. Specifically, as shown... Figure 4 As shown in one embodiment of this specification, the client receives the username and password entered by the user, and then generates a first communication key using a key derivation function with the username, password, and the client's local authentication data. It should be noted that, to enhance the authentication method, a first preset password and a first count value are added to the local authentication data. This method, which uses three sets of authentication data—user password, preset password, and auto-incrementing count value—to directly or indirectly participate in the authentication process, no longer relies solely on the user password. Even if an attacker obtains the user password, the lack of the preset password and the correct count value prevents subsequent authentication from being completed, greatly increasing the difficulty for attackers to crack the authentication, effectively preventing unauthorized login from different locations, and improving overall security. Furthermore, the introduction of the auto-incrementing count value makes each authentication process somewhat dynamic. Even if an attacker intercepts authentication information at a certain time, the count value will automatically increment, rendering the information invalid for the next authentication, further enhancing authentication security and reducing the risk of replay attacks.
[0021] Furthermore, since the users in the authentication process include not only those who have already registered and logged in, but also new users, and new users lack their preset password and initial counter value, in order to solve this problem, in one or more embodiments of this specification, before the client receives the username and password input by the user and generates the first communication key by combining the username, password and local authentication data, the method further includes the following process: like Figure 2 The client receives the username entered by the user and queries its local file to determine if the username's local authentication information exists, thus confirming whether the user is a new user. If confirmed as a new user, the client receives a second pre-set password generated by the server based on the PostgreSQL database, and generates an initial counter value corresponding to that username. This second pre-set password, generated by the PostgreSQL database in response to user creation information, is based on a random number. The client then saves the username, its second pre-set password, and the initial counter value to its local file for subsequent authentication.
[0022] Specifically, in one or more embodiments of this specification, the user name, user password, and local authentication data are used to generate a first communication key through a key derivation function, which specifically includes: The client performs an XOR operation between the user password and the first preset password from the local authentication data to obtain the first key value. Then, it retrieves the key bit length generated based on the authentication security requirements information from the PostgreSQL database. The key bit length, the first key value, the first counter value, and the index of the derived key are input into the key derivation function, which outputs the first communication key. It should be noted that the index of the derived key represents the currently generated key during the communication key generation process. In a certain application scenario, the key derivation function is: Ki = KDF(K, i, counter, length); where: K = user password ⊕ preset password, i.e., the result of the XOR operation between the user password and the preset password; i is the index of the derived key, usually an integer representing the i-th generated key; counter is the counter value; and length is the bit length of the generated key, which can be set according to specific needs. KDF is the key derivation function, which can choose algorithms such as the conventional PBKDF2 (Password-Based Key Derivation Function 2) or HKDF (HMAC-based Key Derivation Function).
[0023] S102: The server receives the username sent by the client and queries the PostgreSQL database to obtain the stored user password and authentication data corresponding to the username; wherein, the authentication data includes: a second preset password and a second count value.
[0024] like Figure 4 As shown, during the authentication process, after the server receives the username sent by the client, it queries the PostgreSQL database to retrieve the stored user password and authentication data corresponding to the username. It should be noted that the authentication data includes: a second preset password and a second counter value. Furthermore, as described in step S101 above, the users in the authentication process include not only previously registered and logged-in users but also new users. Therefore, in one or more embodiments of this specification, before the server receives the username sent by the client and queries the PostgreSQL database to retrieve the stored user password and authentication data corresponding to the username, the method further includes: The server receives user creation information and creates a new username for the new user, generating an initial counter value for that username. Simultaneously with user creation, in response to the user creation information, the PostgreSQL database generates a second preset password based on random numbers and stores this second preset password along with the initial counter value in the PostgreSQL database's system table. In other words, while creating a new user, the PostgreSQL database system generates a preset password using random numbers, and then saves the username, preset password, and initial counter value (initially 1) to the system table. This process, using the PostgreSQL database to generate a second preset password based on random numbers, ensures a high degree of randomness and unpredictability. Compared to user-set passwords, randomly generated passwords are less likely to be guessed or obtained through common password cracking methods, significantly increasing the difficulty for attackers to obtain complete authentication information, thereby improving system security. Furthermore, an initial count value is set, for example, to 1, and stored in a database system table. This count value increments automatically during the authentication process. This makes it difficult for attackers to know the current valid count value. Even if an attacker obtains some information from the database, they cannot accurately know the current count value status, thereby further enhancing the security of the authentication process and effectively preventing attacks based on the count value.
[0025] Furthermore, in one feasible embodiment, obtaining the key bit length generated from the authentication security requirement information based on the PostgreSQL database may specifically include the following process: The server first retrieves information related to the specific business scenario in which the PostgreSQL database is used, as different business scenarios have different update speeds. For example, e-commerce business scenarios may change frequently due to promotional activities, new product launches, etc., resulting in a fast update speed; while internal enterprise document management systems have relatively fewer business changes. The time interval for subsequent evaluation of the key bit length is determined based on this update speed. Scenarios with fast updates may require shorter evaluation periods to quickly adapt to changes in security requirements, while scenarios with slow updates can have relatively longer evaluation periods. Therefore, the evaluation time period for the key bit length can be determined based on the update speed of the business scenario.
[0026] Based on the evaluation time period, the server receives authentication security requirement information from the PostgreSQL database. Then, based on the matching relationship between pre-set event trigger keywords and the authentication security requirement information, it determines whether to trigger a key bit length update task. For example, keywords such as "major security vulnerability exposure," "industry encryption standard upgrade," and "internal authentication attack incident" will be matched in the received authentication security requirement information. This means that the current key bit length does not meet the current security authentication requirements, triggering a key bit length update task. Then, based on the number of matches of the pre-set event trigger keywords corresponding to the update task, the ideal adjustment length of the key bit length is determined. It can be understood that the more matching keywords, the greater the change in the security situation, requiring a more significant increase in the key bit length to improve authentication security. After determining the ideal adjustment length, since the change in key bit length affects the storage of communication keys, the additional storage amount of communication keys must be calculated based on this ideal adjustment length. Comparing the remaining storage capacity of the PostgreSQL database with the newly added storage capacity, if the remaining capacity is greater than or equal to the new storage amount, it means that the storage resources can support adjusting the key bit length according to the ideal adjustment length within this evaluation period, and there will be no problem due to insufficient storage space. Conversely, if the remaining storage capacity is less than the new storage amount, it means that adjusting to the ideal adjustment length will result in storage resource shortages. If it is determined that the storage resources can meet the demand, the key bit length is adjusted based on the ideal adjustment length. Otherwise, the ideal adjustment length needs to be decreased sequentially to adjust the key bit length.
[0027] By determining the assessment time period based on the business update speed of the business scenario and receiving authentication security requirements accordingly, changes in the security environment can be captured in a timely manner, thus ensuring that the authentication security of the PostgreSQL database matches the actual security requirements. Furthermore, the ideal adjustment length of the key bit length is determined based on the number of matches of preset event trigger keywords, making the adjustment of security measures flexible and avoiding the waste caused by over-configuration of resources while ensuring security.
[0028] S103: The server generates a second communication key by using the username, the stored user password, and the authentication data through a key derivation function.
[0029] To execute the secure authentication process for user login to the PostgreSQL database, the server in this embodiment generates a second communication key using a key derivation function, taking the username, stored user password, and authentication data. Specifically, after retrieving the user password, preset password, and counter value corresponding to the username sent by the client from the PostgreSQL database, the server uses the stored user password, the second preset password, and the second counter value from the PostgreSQL database to generate a communication key using the key derivation function.
[0030] Specifically, in one or more embodiments of this specification, the server generates a second communication key from the username, stored user password, and authentication data using a key derivation function, specifically including the following process: Corresponding to step S101 above, where the client generates the first communication key via a key derivation function, the server also performs an XOR operation on the second preset password storing the user password and authentication data to obtain the server-side second key value. Then, the server obtains the key bit length generated based on the authentication security requirements information of the PostgreSQL database. It then inputs the key bit length, the second key value, the second counter value, and the index of the derived key into the key derivation function, and outputs the second communication key based on the key derivation function. Because a preset key is used to generate the authentication communication key, this process ensures that attackers cannot log in from a different location even if the user password is leaked. Furthermore, the use of an auto-incrementing counter value in generating the communication key implements a one-time pad communication mechanism, further enhancing the security of the authentication process.
[0031] S104: The server receives the first communication key to perform password authentication based on the first communication key and the second communication key, and obtains the authentication result of the PostgreSQL database.
[0032] After the client and server each generate the same set of communication keys, the regular authentication process begins. The server receives the first communication key and uses it in conjunction with a second communication key to perform password authentication and obtain the authentication result from the PostgreSQL database. In other words, the authentication data exchanged during the authentication process is encrypted using the aforementioned communication keys. If the user password, preset password, or counter value used by the client and server differs, the communication keys generated by both parties will also differ. That is, if the first and second communication keys are different, the authentication process fails; otherwise, it succeeds.
[0033] Specifically, in one or more embodiments of this specification, the server receives a first communication key to perform password authentication based on the first communication key and a second communication key, and obtains the authentication result of the PostgreSQL database, specifically including the following process: The server receives the first communication key and compares it with the second communication key. This is because both the client and server simultaneously generate the first and second communication keys using three sets of authentication data: the user password, the preset password, and the auto-incrementing counter. Therefore, if the first and second communication keys match, the PostgreSQL database authentication result is considered successful. Conversely, if the first and second communication keys do not match, the PostgreSQL database authentication result is considered failed.
[0034] Furthermore, in one or more embodiments of this specification, after the server receives a first communication key to perform password authentication based on the first communication key and a second communication key, and obtains the authentication result of the PostgreSQL database, the method further includes the following process: like Figure 4 As shown, if the authentication result of the PostgreSQL database is determined to be successful, the client and server respectively increment the first and second count values by a preset value of 1. Conversely, if the authentication result of the PostgreSQL database is determined to be unsuccessful, neither the client nor the server increments the first and second count values. Therefore, in this embodiment, the client and server simultaneously use three sets of authentication data—user password, preset password, and incrementing count value—to directly or indirectly participate in the authentication process. The leakage of any one or two sets of authentication data will not cause unauthorized login from a different location. Unauthorized login from a different location is only possible when all three sets of authentication data are leaked simultaneously. In this case, because the client and server automatically synchronize through the incrementing count value, the legitimate user will inevitably fail to log in on the next attempt. This allows for timely detection of unauthorized login events and enables timely and effective countermeasures.
[0035] like Figure 5 As shown in the diagram, this specification provides a schematic diagram of the structure of a PostgreSQL database security authentication device in an embodiment. Figure 5 As can be seen, in one or more embodiments of this specification, a PostgreSQL database security authentication device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described above.
[0036] like Figure 6 As shown in the diagram, this specification provides a schematic diagram of the structure of a non-volatile storage medium in an embodiment. Figure 6 As can be seen, in one or more embodiments of this specification, a non-volatile storage medium stores computer-executable instructions 601, which are capable of executing any of the methods described above.
[0037] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0038] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0039] The above description is merely one or more embodiments of this specification and is not intended to limit this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of this specification.
Claims
1. A method for PostgreSQL database security authentication, characterized in that, The method includes: The client receives the username and password input by the user, and generates a first communication key by using the username, the password and local authentication data through a key derivation function; wherein, the local authentication data includes: a first preset password and a first count value; The server receives a username sent by the client and queries the PostgreSQL database to obtain the stored user password and authentication data corresponding to the username; wherein, the authentication data includes: a second preset password and a second counter value; The server generates a second communication key using the username, the stored user password, and the authentication data through a key derivation function. The server receives the first communication key and performs password authentication based on the first communication key and the second communication key to obtain the authentication result of the PostgreSQL database.
2. The method for PostgreSQL database security authentication according to claim 1, characterized in that, Before the client receives the username and password input by the user, and generates a first communication key by combining the username, the password, and local authentication data, the method further includes: The client receives the username and queries the username based on the client's local files to determine whether the username corresponds to a new user; If so, the server receives the second preset password corresponding to the username, generated based on the PostgreSQL database, and generates an initial count value corresponding to the username. The username, the corresponding second preset password, and the initial count value are saved to a local file on the client.
3. The method for PostgreSQL database security authentication according to claim 1, characterized in that, Before the server receives the username sent by the client and queries the PostgreSQL database to retrieve the stored user password and authentication data corresponding to the username, the method further includes: The server receives user creation information, creates a new username corresponding to the new user based on the user creation information, and generates an initial count value corresponding to the username. In response to the user creation information, the PostgreSQL database generates a second preset password based on a random number and stores the second preset password and the initial count value in the database system table of the PostgreSQL database.
4. The method for PostgreSQL database security authentication according to claim 1, characterized in that, The first communication key is generated by using the username, the user password, and local authentication data through a key derivation function, specifically including: The client performs an XOR operation between the user password and the first preset password of the local authentication data to obtain the first key value; Obtain the key bit length generated based on the authentication security requirement information of the PostgreSQL database; The key bit length, the first key value, the first count value, and the index of the derived key are input into the key derivation function to output the first communication key according to the key derivation function; wherein, the index of the derived key is used to represent the key currently generated during the communication key generation process.
5. The method for PostgreSQL database security authentication according to claim 4, characterized in that, The server generates a second communication key from the username, the stored user password, and the authentication data using a key derivation function, specifically including: The server performs an XOR operation between the stored user password and the second preset password of the authentication data to obtain the second key value; Obtain the key bit length generated based on the authentication security requirement information of the PostgreSQL database; The key bit length, the second key value, the second count value, and the index of the derived key are input into the key derivation function to output the second communication key according to the key derivation function.
6. The method for PostgreSQL database security authentication according to claim 1, characterized in that, The server receives the first communication key and performs password authentication based on the first communication key and the second communication key to obtain the authentication result of the PostgreSQL database, specifically including: The server receives the first communication key and compares it with the second communication key. If the first communication key matches the second communication key, then the authentication result of the PostgreSQL database is determined to be successful. If the first communication key is inconsistent with the second communication key, then the authentication result of the PostgreSQL database is determined to be authentication failure.
7. The method for PostgreSQL database security authentication according to claim 1, characterized in that, After the server receives the first communication key and performs password authentication based on the first communication key and the second communication key to obtain the authentication result of the PostgreSQL database, the method further includes: If the authentication result of the PostgreSQL database is determined to be successful, the client and the server respectively increment the first count value and the second count value by a preset value; wherein, the preset value is 1; If the authentication result of the PostgreSQL database is determined to be authentication failure, neither the client nor the server will increment the first count value and the second count value by a preset value.
8. The method for PostgreSQL database security authentication according to claim 4, characterized in that, The step of obtaining the key bit length generated based on the authentication security requirement information of the PostgreSQL database specifically includes: The server obtains the business scenario corresponding to the PostgreSQL database, and determines the evaluation time period for the key bit length based on the business update speed of the business scenario. Based on the aforementioned evaluation time period, the authentication security requirement information of the PostgreSQL database is received; Based on the matching relationship between the preset event trigger keywords and the authentication security requirement information, it is determined whether to trigger the key bit length update task; If so, the ideal adjustment length of the key bit length is determined based on the number of matching keywords of the preset event triggered by the update task. The additional storage amount of the communication key is determined based on the ideal adjustment length of the key bit length. Based on the remaining storage capacity of the PostgreSQL database and the additional storage capacity, it is determined whether the storage resources within the evaluation period meet the operating requirements of the PostgreSQL database. If so, the key bit length is adjusted based on the ideal adjustment length; If not, then the ideal adjustment length is decreased sequentially to adjust the key bit length.
9. A device for PostgreSQL database security authentication, the device comprising: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in any one of claims 1-8.
10. A non-volatile storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of performing the method described in any one of claims 1-8.
