Password generation method and device, equipment and storage medium
By using the quantum random number generator to generate random password length and initial character set, randomly generating strings, combined with rule filtering, the security problem of modern password generation methods in front of quantum computers is solved, and high-security password generation is achieved.
Patent Information
- Application Number
- CN202510313995.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-07-18
AI Technical Summary
Modern password generation methods cannot meet scenarios with extremely high security requirements, especially in the security challenges facing quantum computers.
The quantum random number generator is used to generate the random password length, and the initial character set is randomly generated and disrupted, so that the final password is obtained through rule filtering.
It improves the randomness and security level of passwords, enhances the unpredictability of passwords, and meets the scenario needs with extremely high security requirements.
Smart Images

Figure CN120337202A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a password generation method, apparatus, device and storage medium. Background Art
[0002] Modern cryptographic systems have been proven to be no longer secure in the face of the super-strong parallel computing capabilities of quantum computers. Traditional random number generation methods are essentially based on deterministic algorithms, which leads to the risk of current password generation methods being predicted and cracked, and cannot meet the needs of scenarios with extremely high security requirements.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide a password generation method, device, equipment and storage medium, aiming to solve the technical problem that the current password generation method cannot meet the scenarios with extremely high security requirements.
[0005] To achieve the above purpose, the present application proposes a password generation method, which is applied to a database platform, and the method comprises:
[0006] Receiving a password generation rule, and calling a quantum random number generator to generate a random password length based on the password generation rule;
[0007] Based on the password generation rule, the random password length and the initial character set, a character string is randomly generated and shuffled to obtain an initial password;
[0008] The initial password is subjected to rule filtering based on the password generation rule to obtain a final password.
[0009] In one embodiment, the password generation rule includes a password length range, and the step of calling a quantum random number generator to generate a random password length based on the password generation rule includes:
[0010] The quantum random number generator is called based on the password length range to generate the random password length.
[0011] In one embodiment, the password generation rule includes a specified character category, and the step of randomly generating and scrambling a character string based on the password generation rule, the random password length and the initial character set to obtain the initial password includes:
[0012] calling the quantum random number generator to generate a first pregenerated password component and a second pregenerated password component based on the specified character category, the random password length, and the initial character set;
[0013] Compose a pre-generated password based on the first pre-generated password component and the second pre-generated password component;
[0014] Shuffle the order of the pre-generated password through a shuffling algorithm and output the initial password.
[0015] In one embodiment, the length of the random password is the sum of the second password length and the third password length. The step of generating the first pre-generated password component and the second pre-generated password component based on the specified character category, the random password length, and the initial character set includes:
[0016] Divide the initial character set into subsets according to the specified character category;
[0017] Generate characters of a preset first password length based on each subset corresponding to the specified character category;
[0018] Compose the first pre-generated password component based on the characters of the preset first password length. The length of the first pre-generated password component is the second password length;
[0019] Combine each subset corresponding to the specified character category into a set;
[0020] Generate the second pre-generated password component based on the set. The length of the second pre-generated password component is the third password length.
[0021] In one embodiment, the step of generating the first pre-generated password component and the second pre-generated password component based on the specified character category, the random password length, and the initial character set includes:
[0022] Generate a number of candidate password components in the initial character set based on the specified character category and the random password length;
[0023] Conduct a complexity analysis on the number of candidate password components;
[0024] Use the two candidate password components with the highest complexity as the first pre-generated password component and the second pre-generated password component.
[0025] In one embodiment, the password generation rule includes a verification rule. The step of filtering the initial password based on the password generation rule to obtain the final password includes:
[0026] Verify the initial password based on the verification rule;
[0027] If the verification passes, output the initial password as the final password;
[0028] If the verification fails, return to execute the steps: receive the password generation rule, and based on the password generation rule, call a quantum random number generator to generate a random password length.
[0029] In one embodiment, the step of receiving the input verification rule includes at least one of the following:
[0030] Receive the verification rule that the initial password contains uppercase letters, lowercase letters and numbers at the same time;
[0031] Receive the verification rule that the initial password cannot have consecutive digits;
[0032] Receive the verification rule that the initial password contains at least two types of characters;
[0033] Receive the verification rule that the initial password cannot contain personal information;
[0034] Receive the verification rule that the initial password cannot coincide with the passwords in the preset blacklist;
[0035] Receive the verification rule that the initial password cannot contain consecutive characters on the keyboard.
[0036] In addition, to achieve the above object, the present application also proposes a password generation device, which is set in the database platform. The password generation device includes:
[0037] A password length generation module, configured to receive a password generation rule, and based on the password generation rule, call a quantum random number generator to generate a random password length;
[0038] An initial password generation module, configured to randomly generate a string based on the password generation rule, the random password length and an initial character set and shuffle it to obtain an initial password;
[0039] A rule filtering module, configured to perform rule filtering on the initial password based on the password generation rule to obtain a final password.
[0040] In addition, to achieve the above object, the present application also proposes a password generation device, the device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the password generation method as described above.
[0041] In addition, to achieve the above object, the present application also proposes a storage medium, the storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the password generation method as described above are implemented.
[0042] One or more technical solutions proposed by the present application have at least the following technical effects:
[0043] In this application, the length of the random password is generated by using a quantum random number generator. Since quantum random numbers have characteristics such as unpredictability, non-repeatability, and unbiasedness, true random numbers can be generated based on the principles of quantum physics and are thus unpredictable. This application randomly generates a string based on the length of the random password and the initial character set and shuffles it to obtain the initial password. The initial password is filtered according to rules to obtain the final password, which can further increase the randomness of the password and improve the security level of the generated password. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with this application and used together with the specification to explain the principles of this application.
[0045] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0046] Figure 1 It is a schematic flowchart provided for the first embodiment of the password generation method of this application;
[0047] Figure 2 It is a schematic flowchart for briefly realizing database password security in this application;
[0048] Figure 3 It is a schematic flowchart for briefly describing the password generation method of this application;
[0049] Figure 4 It is a schematic diagram of the module structure of the password generation device for the embodiment of this application;
[0050] Figure 5 It is a schematic diagram of the device structure of the hardware operating environment involved in the password generation method for the embodiment of this application.
[0051] The realization of the purpose, functional features, and advantages of this application will be further described with reference to the embodiments and the drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] It should be understood that the specific embodiments described here are only used to explain the technical solutions of this application and are not used to limit this application.
[0053] To better understand the technical solutions of this application, the following will be described in detail in combination with the drawings of the specification and the specific embodiments.
[0054] The main solution of the embodiment of the present application is: receiving a password generation rule, calling a quantum random number generator to generate a random password length based on the password generation rule; randomly generating a character string based on the password generation rule, the random password length and the initial character set and scrambling it to obtain an initial password; and performing rule filtering on the initial password based on the password generation rule to obtain a final password.
[0055] In this embodiment, for ease of description, the password generation system is used as the execution subject for explanation below.
[0056] Modern cryptographic systems have been proven to be no longer secure in the face of the super-strong parallel computing capabilities of quantum computers. Traditional random number generation methods are essentially based on deterministic algorithms, which leads to the risk of current password generation methods being predicted and cracked, and cannot meet scenarios with extremely high security requirements.
[0057] The present application provides a solution. The present application generates a random password length by using a quantum random number generator. Since quantum random numbers have the characteristics of unpredictability, non-repeatability and unbiasedness, true random numbers can be generated based on the principles of quantum physics, making them unpredictable. The present application randomly generates a string based on the random password length and the initial character set and shuffles it to obtain an initial password. The initial password is filtered by rules to obtain a final password, which can further increase the randomness of the password and improve the security level of the generated password.
[0058] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a password generating device, etc., or an electronic system capable of realizing the above functions, a password generating system, etc. The following takes the password generating system as an example to illustrate this embodiment and the following embodiments.
[0059] Based on this, the present application embodiment provides a password generation method, referring to Figure 1 , Figure 1 A flowchart of the first embodiment of the password generation method of the present application is provided.
[0060] In this embodiment, applied to a database platform, the password generation method includes steps S10 to S30:
[0061] Step S10, receiving a password generation rule, and calling a quantum random number generator to generate a random password length based on the password generation rule;
[0062] The embodiments of the present application can be applied to database platforms, such as Figure 2 As shown, Figure 2This is a schematic diagram of the brief process for the present application to achieve database password security. Through the database platform, the quantum random number service is called, and through the quantum random number service, the quantum random number generator is called to generate random numbers and perform secondary shuffling and rule filtering according to rules.
[0063] Among them, the length of the generated password is random, which can avoid the possibility of inferring the password through the password length and enhance the security of the password.
[0064] Step S20: Randomly generate a string based on the password generation rule, the random password length, and the initial character set, and shuffle it to obtain the initial password.
[0065] Among them, the initial character set can include letters, numbers, symbols, etc.
[0066] Among them, performing secondary shuffling on the generated string can further increase the randomness and complexity of the password.
[0067] Step S30: Perform rule filtering on the initial password based on the password generation rule to obtain the final password.
[0068] Among them, rule checking can be performed on the initial password to ensure that the initial password conforms to the preset security rules (such as including uppercase letters, lowercase letters, numbers, special characters, etc.). If the initial password does not conform to the rules, it is regenerated or adjusted until the requirements are met.
[0069] Furthermore, assume that the embodiment of the present application is used to generate a database password. Since a secure random string needs to be dynamically generated as the initialization password of the database user during the initialization of the database creation, the security of this random string will directly affect the security of the database, thereby affecting the data security of the business. By receiving the password generation rule of the embodiment of the present application, based on the password generation rule, the quantum random number generator is called to generate a random password length, based on the password generation rule, the random password length, and the initial character set, a string is randomly generated and shuffled to obtain the initial password, and based on the password generation rule, rule filtering is performed on the initial password to obtain the final password, thereby increasing the randomness of the password and improving the security level of the generated password.
[0070] This embodiment provides a password generation method. In the present application, the quantum random number generator is used to generate a random password length. Since quantum random numbers have characteristics such as unpredictability, non-repeatability, and unbiasedness, true random numbers can be generated based on the principles of quantum physics and are thus unpredictable. The present application randomly generates a string based on the random password length and the initial character set and shuffles it to obtain the initial password, and performs rule filtering on the initial password to obtain the final password, which can further increase the randomness of the password and improve the security level of the generated password.
[0071] Based on Embodiment 1 of the present application, in Embodiment 2 of the present application, the same or similar content as that in the above Embodiment 1 can be referred to the above introduction and will not be repeated hereinafter. On this basis, the password generation rule includes a password length range, and the step S10 of receiving the password generation rule and calling the quantum random number generator based on the password generation rule to generate a random password length further includes the step S11:
[0072] Among them, the password length range is set by the user according to specific needs, and can be a fixed length (such as 10 digits) or an interval (such as 8 - 12 digits).
[0073] Step S11, calling the quantum random number generator based on the password length range to generate the random password length.
[0074] Among them, within the password length range provided by the user, the quantum random number generator is called to generate a random number as the specific length of the password. For example, if the range input by the user is 8 - 12 digits, the quantum random number generator will generate a random number within this range (such as 9 digits, 11 digits, etc.).
[0075] In the embodiment of the present application, by calling the quantum random number generator based on the password length range to generate the random password length, it is ensured that the password length is randomly generated within the range specified by the user, which not only meets the user's needs but also enhances the unpredictability and security of the password.
[0076] Based on Embodiment 1 of the present application, in Embodiment 3 of the present application, the same or similar content as that in the above Embodiment 1 can be referred to the above introduction and will not be repeated hereinafter. On this basis, the password generation rule includes specified character categories, and the step S20 of randomly generating and scrambling a string based on the password generation rule, the random password length, and the initial character set to obtain an initial password further includes steps S21 - S23:
[0077] Among them, the character categories include uppercase letters, lowercase letters, numbers, special characters, etc.
[0078] For example, the password specified by the user needs to include both uppercase letters and lowercase letters.
[0079] Step S21, calling the quantum random number generator to generate a first pre-generated password component and a second pre-generated password component based on the specified character categories, the random password length, and the initial character set;
[0080] For example, calling the quantum random number generator to generate a random password length of 10 digits.
[0081] The initial character set includes uppercase letters A - Z and lowercase letters a - z.
[0082] The first pre-generated password component is randomly selected 4 digits from A-Z, such as "QwEr".
[0083] The second pre-generated password component is randomly selected 6 digits from a-z, such as "tyuiop".
[0084] Step S22, form a pre-generated password based on the first pre-generated password component and the second pre-generated password component;
[0085] Among them, forming a pre-generated password based on the first pre-generated password component and the second pre-generated password component may include the following 5 methods:
[0086] (1) Directly concatenate the first pre-generated password component and the second pre-generated password component in sequence.
[0087] (2) Alternately insert the characters of the first pre-generated password component and the second pre-generated password component to form a pre-generated password.
[0088] (3) Randomly insert the characters of the first pre-generated password component and the second pre-generated password component into the pre-generated password.
[0089] (4) After segmenting the first pre-generated password component and the second pre-generated password component, combine them together. Among them, the quantum random number generator can be called to segment the first pre-generated password component and the second pre-generated password component.
[0090] (5) Combine the first pre-generated password component and the second pre-generated password component into a character array, and then randomly sort them through a shuffling algorithm.
[0091] Step S23, shuffle the order of the pre-generated password through a shuffling algorithm, and output the initial password.
[0092] Among them, the shuffling algorithm can include the Fisher-Yates shuffling algorithm, the random sorting shuffling algorithm, the random swapping shuffling algorithm, etc.
[0093] Among them, the Fisher-Yates shuffling algorithm regards the password as an array, starts from the last element of the array, traverses forward. For the current element (index i), randomly select an index j (the range of j is 0 to i), and swap the current element (i) with the randomly selected element (j). Repeat the above steps until the entire array is traversed.
[0094] Among them, the random sorting shuffling algorithm realizes shuffling by generating a random number for each password element and sorting based on it.
[0095] Among them, the random swapping shuffling algorithm realizes shuffling by randomly swapping individual elements in the password multiple times.
[0096] In the embodiment of the present application, by receiving a specified character category, generating pre-generated password components, combining the components and shuffling them through a shuffling algorithm, an initial password with high randomness and high complexity is generated, thereby improving the security of password generation.
[0097] Based on Embodiment 3 of the present application, in Embodiment 4 of the present application, the same or similar content as that in Embodiment 3 above can be referred to the above introduction and will not be elaborated hereinafter. On this basis, the length of the random password is the sum of the second password length and the third password length. The step S22 of generating the first pre-generated password component and the second pre-generated password component based on the specified character category, the random password length, and the initial character set further includes steps S221 to S225:
[0098] Step S221, divide the initial character set into subsets according to the specified character category;
[0099] For example, if the initial character set includes all types of characters and the specified character category is uppercase letters and lowercase letters, the subsets divided based on the initial character set are the uppercase letter set and the lowercase letter set.
[0100] Step S222, generate characters with a preset first password length based on each subset corresponding to the specified character category;
[0101] For example, the preset first password length is 3. Generate characters with a length of 3 based on the uppercase letter set and generate characters with a length of 3 based on the lowercase letter set.
[0102] Step S223, form the first pre-generated password component based on the characters with the preset first password length, and the length of the first pre-generated password component is the second password length;
[0103] Among them, the characters with a length of 3 generated based on the uppercase letter set and the characters with a length of 3 generated based on the lowercase letter set form the first pre-generated password component, and the length of the first pre-generated password component is the second password length, that is, the second password length is 6.
[0104] Step S224, form a collection of each subset corresponding to the specified character category;
[0105] For example, form a collection of the uppercase letter set and the lowercase letter set.
[0106] Step S225, generate the second pre-generated password component based on the collection, and the length of the second pre-generated password component is the third password length.
[0107] Among them, assuming that the length of the random password is 10, since the length of the random password is the sum of the lengths of the second password and the third password, the length of the third password is 4. Therefore, a second pre-generated password component with a length of 4 is generated based on the said collection.
[0108] The said step S22, generating the first pre-generated password component and the second pre-generated password component based on the said specified character category, the length of the random password, and the initial character set further includes steps S226 to S228:
[0109] Step S226, generating a number of candidate password components in the initial character set based on the said specified character category and the length of the random password;
[0110] Among them, a quantum random number generator is used to randomly generate a number of candidate password components in the initial character set. The length of each candidate password component is the length of the random password.
[0111] Step S227, performing complexity analysis on the said number of candidate password components;
[0112] Among them, the complexity analysis indicators may include the following four points:
[0113] 1. Diversity of character types: The number of character categories included in the password (such as uppercase letters, lowercase letters, numbers, special characters).
[0114] 2. Uniformity of character distribution: Whether the characters are evenly distributed in the password.
[0115] 3. Randomness: Whether the password meets the randomness requirements and avoids simple patterns.
[0116] 4. Entropy value: Calculate the entropy value of the password to evaluate its information content.
[0117] Step S228, taking the two candidate password components with the highest complexity as the said first pre-generated password component and the second pre-generated password component.
[0118] Among them, according to the complexity score, select the two candidate password components with the highest scores. Take the one with the highest score as the first pre-generated password component and the second highest as the second pre-generated password component.
[0119] The embodiments of the present application generate the first pre-generated password component and the second pre-generated password component through a series of rules, improving the randomness and security of the password.
[0120] Based on the above embodiments, in the fifth embodiment of the present application, for the same or similar content as the above embodiments, reference can be made to the above introduction and will not be elaborated hereinafter. On this basis, step S30 of filtering the initial password based on the password generation rule to obtain the final password further includes steps S31 to S34:
[0121] Step S31, receive the input verification rule;
[0122] Among them, the verification rule can be defined and / or input by the user. For example, the Oracle database password cannot contain special characters, such as the password cannot contain consecutive numbers, etc.
[0123] Step S32, verify the initial password based on the verification rule;
[0124] Step S33, if the verification passes, output the initial password as the final password;
[0125] Step S34, if the verification fails, return to execute the steps: receive the password generation rule, and based on the password generation rule, call the quantum random number generator to generate a random password length.
[0126] Among them, if the initial password fails the check of the verification rule, receive the password generation rule again, call the quantum random number generator to generate a random password length based on the password generation rule, and re-execute the subsequent steps.
[0127] In the fifth embodiment of the present application, by receiving the verification rule, verifying the initial password, outputting the final password or regenerating the password, it is ensured that the generated password meets specific security requirements or business rules.
[0128] The password generated based on the quantum random number and the shuffling algorithm in the present application can be used for different types of database passwords after being filtered by the verification rule. It should be noted that the core of this solution is to combine the quantum random number and the designed random algorithm. Utilize the quantum physical true randomness of the quantum random number in terms of password length, password segment randomness, and overall randomness, and at the same time use the shuffling random algorithm to further increase the randomness of the password, which can effectively solve the current problem of pseudo-randomness. The designed database password checker meets the rule requirements of the database password. Therefore, it can be seen that the design solution proposed in the present application improves the security level of the database password.
[0129] Based on the fifth embodiment of the present application, in the sixth embodiment of the present application, for the same or similar content as the fifth embodiment above, reference can be made to the above introduction and will not be elaborated hereinafter. On this basis, step S31 of receiving the input verification rule further includes at least one of steps S311 to S312:
[0130] Step S311, receive the verification rule that the initial password contains capital letters, lowercase letters, and numbers at the same time;
[0131] Step S312, receive the verification rule that there cannot be consecutive numbers in the initial password.
[0132] Further, when applied to a high-risk database platform, step S31, receiving the input verification rules further includes steps S313 to S316:
[0133] Step S313, receive the verification rule that the initial password contains at least two types of characters;
[0134] Step S314, receive the verification rule that the initial password cannot contain personal information;
[0135] Among them, the initial password shall not contain the user's personal information (such as name, birthday, mobile phone number, etc.), so as to avoid the password being speculated by intruders through personal information.
[0136] Step S315, receive the verification rule that the initial password cannot coincide with the passwords in the preset blacklist;
[0137] Among them, a blacklist of common password patterns can be maintained, and a common password pattern can be "12345".
[0138] Step S316, receive the verification rule that the initial password cannot contain consecutive characters on the keyboard.
[0139] Through the introduction of more complex verification rules in the embodiments of the present application, the quality and anti-attack ability of passwords can be significantly improved.
[0140] Exemplarily, to help understand the implementation process of the above embodiments, please refer to Figure 3 , Figure 3 which is a schematic flowchart of the brief process of the password generation method of the present application. Specifically, the process includes the following steps 1 to 5:
[0141] Step 1, receive the input database password length range, password character set, and verification rules.
[0142] Step 2, randomly generate a password length according to the database password length range.
[0143] Step 3, pre-generate a database password. The pre-generated password consists of two parts, both generated by calling a quantum random number generator. One part is randomly generated based on a subset of the character set required by the user, and the other part is randomly generated based on the set of the character set.
[0144] First, divide the character sets required to be included in the user input into subsets according to categories, and randomly generate a character within each required subset to form the first pre-generated password component.
[0145] Then, form a collection of the required character subsets, and randomly generate the second pre-generated password component within the collection.
[0146] Through the formula: pre-generated password = first pre-generated password component + second pre-generated password component, obtain the pre-generated password.
[0147] Step 4: Randomly shuffle the pre-generated password. Based on the pre-generated password, use the shuffling algorithm to randomly shuffle its order. The length of the output shuffled password remains unchanged, only the order is shuffled.
[0148] Step 5: Database password rule verification. Verify the shuffled pre-generated password according to the input verification rules, such as special characters that cannot be included in the Oracle database password, such as the password cannot contain consecutive numbers, such as high-risk databases must contain multiple types of characters, and it can also be filtered and verified according to the input verification rules. If the verification passes, the database password generation is successful; if the verification fails, restart from step 2.
[0149] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the password generation method of this application. Based on this technical concept, more forms of simple transformations are within the protection scope of this application.
[0150] This application also provides a password generation device. Please refer to Figure 4 , which is set on the database platform. The password generation device includes:
[0151] A password length generation module 10, configured to receive a password generation rule, and call a quantum random number generator to generate a random password length based on the password generation rule;
[0152] An initial password generation module 20, configured to randomly generate a string based on the password generation rule, the random password length, and an initial character set and shuffle it to obtain an initial password;
[0153] A rule filtering module 30, configured to perform rule filtering on the initial password based on the password generation rule to obtain a final password.
[0154] The password generation device provided by the present application adopts the password generation method in the above embodiment, and can solve the technical problem that the current password generation method cannot meet the scenarios with extremely high security requirements. Compared with the prior art, the beneficial effects of the password generation device provided by the present application are the same as those of the password generation method provided by the above embodiment, and other technical features in the password generation device are the same as the features disclosed in the method of the above embodiment, which will not be elaborated herein.
[0155] The present application provides a password generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the password generation method in the first embodiment above.
[0156] Reference is made below to Figure 5 , which shows a schematic structural diagram of a password generation device suitable for implementing the embodiments of the present application. The password generation device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The password generation device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0157] As Figure 5As shown, the password generation device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1002 or the program loaded from the storage device 1003 into the random access memory 1004. In the random access memory 1004, various programs and data required for the operation of the password generation device are also stored. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other through a bus 1005. The input / output interface 1006 is also connected to the bus. Generally, the following systems can be connected to the input / output interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the password generation device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a password generation device having various systems, it should be understood that it is not required to implement or have all the shown systems. Instead, more or fewer systems can be implemented or had.
[0158] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device, or installed from the storage device 1003, or installed from the read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are executed.
[0159] The password generation device provided in the present application adopts the password generation method in the above embodiment, and can solve the technical problem that the current password generation method cannot meet the scenarios with extremely high security requirements. Compared with the prior art, the beneficial effects of the password generation device provided in the present application are the same as those of the password generation method provided in the above embodiment, and the other technical features in the password generation device are the same as those disclosed in the method of the previous embodiment, and will not be elaborated here.
[0160] It should be understood that the various parts disclosed in the present application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0161] As described above, it is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims described above.
[0162] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the password generation method in the above embodiments.
[0163] The computer-readable storage medium provided by the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0164] The above computer-readable storage medium may be included in the password generation device; or it may exist separately and not be assembled into the password generation device.
[0165] The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed by the password generation device, the password generation device is caused to: receive a password generation rule, call a quantum random number generator to generate a random password length based on the password generation rule; randomly generate and scramble a string based on the password generation rule, the random password length, and an initial character set to obtain an initial password; and perform rule filtering on the initial password based on the password generation rule to obtain a final password.
[0166] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by connecting through the Internet using an Internet service provider).
[0167] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of the code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0168] The modules described in the embodiments of this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.
[0169] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned password generation method, and can solve the technical problem that the current password generation method cannot meet the scenarios with extremely high security requirements. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the password generation method provided by the above embodiments, and will not be elaborated here.
[0170] The above are only some embodiments of the present application, and thus do not limit the patent scope of the present application. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or any direct / indirect application in other related technical fields, is included in the patent protection scope of the present application.
Claims
1. A password generation method, characterized in that, Applied to a database platform, the method includes the following steps: Receive a password generation rule, and call a quantum random number generator based on the password generation rule to generate a random password length; Randomly generate a string based on the password generation rule, the random password length, and an initial character set, and shuffle it to obtain an initial password; Perform rule filtering on the initial password based on the password generation rule to obtain a final password.
2. The method according to claim 1, wherein The password generation rule includes a password length range, and the step of calling a quantum random number generator based on the password generation rule to generate a random password length includes: Call the quantum random number generator based on the password length range to generate the random password length.
3. The method according to claim 1, characterized in that The password generation rule includes specified character categories, and the step of randomly generating a string based on the password generation rule, the random password length, and an initial character set, and shuffling it to obtain an initial password includes: Call the quantum random number generator to generate a first pre-generated password component and a second pre-generated password component based on the specified character categories, the random password length, and the initial character set; Form a pre-generated password based on the first pre-generated password component and the second pre-generated password component; Shuffle the order of the pre-generated password through a shuffling algorithm and output the initial password.
4. The method according to claim 3, characterized in that, The random password length is the sum of a second password length and a third password length, and the step of generating a first pre-generated password component and a second pre-generated password component based on the specified character categories, the random password length, and the initial character set includes: Divide the initial character set into subsets according to the specified character categories; Generate characters of a preset first password length based on each subset corresponding to the specified character categories; Form the first pre-generated password component based on the characters of the preset first password length, and the length of the first pre-generated password component is the second password length; Combine each subset corresponding to the specified character categories into a collection; Generate the second pre-generated password component based on the collection, and the length of the second pre-generated password component is the third password length.
5. The method according to claim 3, wherein The step of generating a first pre-generated password component and a second pre-generated password component based on the specified character categories, the random password length, and the initial character set includes: Generate a number of candidate password components in the initial character set based on the specified character categories and the random password length; Perform complexity analysis on the number of candidate password components; Use the two candidate password components with the highest complexity as the first pre-generated password component and the second pre-generated password component.
6. The method according to claim 1, wherein The password generation rule includes a verification rule, and the step of performing rule filtering on the initial password based on the password generation rule to obtain a final password includes: Verify the initial password based on the verification rule; If the verification passes, output the initial password as the final password; If the verification fails, return to execute the steps: receive the password generation rule, and call the quantum random number generator based on the password generation rule to generate a random password length.
7. The method according to claim 6, wherein The step of receiving the input verification rule includes at least one of the following: Receive the verification rule that the initial password contains uppercase letters, lowercase letters and numbers at the same time; Receive the verification rule that there should be no consecutive numbers in the initial password; Receive the verification rule that the initial password contains at least two types of characters; Receive the verification rule that the initial password cannot contain personal information; Receive the verification rule that the initial password cannot coincide with the passwords in the preset blacklist; Receive the verification rule that the initial password cannot contain consecutive characters on the keyboard.
8. A password generation device, characterized in that, Set in the database platform, the device includes: A password length generation module, configured to receive a password generation rule, and call a quantum random number generator based on the password generation rule to generate a random password length; An initial password generation module, configured to randomly generate and scramble a string based on the password generation rule, the random password length, and an initial character set to obtain an initial password; A rule filtering module, configured to perform rule filtering on the initial password based on the password generation rule to obtain a final password.
9. A password generation device, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the password generation method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the password generation method according to any one of claims 1 to 7 are implemented.