Rainbow table password cracking method, device and system based on mask, medium and program product

By introducing mask rules and the generation of rainbow chain chain data into the rainbow table password cracking method, the problem of low cracking rate of existing rainbow tables under the same calculation and storage conditions is solved, and more efficient password cracking is achieved.

CN119814283APending Publication Date: 2025-04-11SHANGHAI HONGZHEN INFORMATION SCI & TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411962429.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Existing rainbow tables cannot provide higher cracking rates with the same computing power and storage power, and the plain text space cannot be customized according to user password rules.

Method used

The mask-based rainbow table password cracking method is used to obtain the table header data, including mask rules, hash functions, streamlined functions and rainbow chain chain length, filter the plaintext space, generate the initial plaintext, calculate the rainbow chain chain data, and generate the rainbow table for cracking.

Benefits of technology

With the same calculation amount and space occupied, the password cracking rate is improved, the number of combinations of plain text space is reduced, and the cracking efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814283A_ABST
    Figure CN119814283A_ABST
Patent Text Reader

Abstract

The invention provides a mask-based rainbow table password cracking method, device and system, a medium and a program product, and the method comprises the steps: obtaining header data which comprises a mask rule, a hash function, a simplification function and a rainbow chain length; and screening the plaintext space according to the mask rule to obtain a corresponding password space, generating a plurality of initial plaintexts based on the password space, calculating chain data of a rainbow chain based on each initial plaintext, and then jointly generating a rainbow table in combination with header data to crack a target ciphertext. According to the method, the masks are used for screening the plaintext space, only a part of plaintext combinations with the high password cracking rate are reserved, and plaintext combinations with the low password cracking rate are deleted, so that the method has the better password cracking rate on the premise of the same calculation amount and occupied space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security, and in particular to a mask-based rainbow table password cracking method, device, system, medium and program product. Background Art

[0002] A rainbow table is a pre-computed table used for the inverse operation of an encrypted hash function. As a commonly used and important means in the field of password cracking, compared to the brute force cracking method that requires higher computing power and the table lookup method that requires higher storage capacity, the rainbow table strikes a compromise between the two and uses affordable time and storage space to crack passwords.

[0003] Nowadays, rainbow tables play an important role in cryptography, digital signatures, electronic keys, electronic passwords, file encryption, verification, password authentication and other related fields. For example, with authorization, security experts can use rainbow tables to test the security of the system and discover weaknesses in the system by cracking passwords; with legal authorization, digital forensics personnel may use rainbow tables to crack encrypted data to obtain evidence needed for case investigations; system administrators can use rainbow tables to evaluate the strength of user passwords, discover weak passwords and strengthen system security; when a user forgets his password, the administrator may need to use rainbow tables to recover or reset the user's password; and so on.

[0004] However, all current rainbow tables use a finite set of characters to form the plaintext space of the password, and each password is a character in the finite character set. The plaintext space is large and cannot be customized according to the user password rules in the real world, which greatly limits the password space range of the rainbow table. It is impossible to provide a rainbow table password cracking solution with a higher cracking rate based on the same computing power and storage capacity. Summary of the invention

[0005] In view of the shortcomings of the prior art mentioned above, the purpose of the present application is to provide a mask-based rainbow table password cracking method, device, system, medium and program product to solve the above-mentioned problem that it is impossible to provide a rainbow table password cracking implementation solution with a higher cracking rate on the basis of the same computing power and storage capacity.

[0006] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a mask-based rainbow table password cracking method, the steps of which include: obtaining header data, wherein the header data includes a mask rule, a hash function, a reduction function and a rainbow chain length; filtering the plaintext space according to the mask rule to obtain the corresponding password space; obtaining the number of rainbow chains according to a preset first acquisition rule; obtaining a number of initial plaintexts equal to the number of rainbow chains according to a preset second acquisition rule, so that the data set composed of all the initial plaintexts is the password space a subset of the time interval; according to the hash function, the reduction function and the length of the rainbow chain, a corresponding rainbow chain is generated for each of the initial plaintexts, and the data located at the head and the tail of the rainbow chain are used as chain data; wherein the structure of the rainbow chain includes: plaintext and ciphertext are arranged alternately and the initial plaintext is set at the head of the chain, each subsequent ciphertext is obtained by the hash function operation of its previous plaintext, and each subsequent plaintext except the initial plaintext is obtained by the reduction function operation of its previous ciphertext; a rainbow table is generated using the header data and the chain data to crack the target ciphertext.

[0007] In an embodiment of the first aspect of the present application, the mask rule includes the number of mask bits and a character set corresponding to each mask bit.

[0008] In an embodiment of the first aspect of the present application, the rainbow chain also includes a placeholder value, and the step of obtaining a number of initial plaintexts equal to the number of the rainbow chains according to a preset second acquisition rule includes: randomly generating a number of placeholder values ​​equal to the number of the rainbow chains, and obtaining the initial plaintext by taking the placeholder values ​​modulo the size of the character set space corresponding to each bit mask; and setting the placeholder value before the initial plaintext in the rainbow chain.

[0009] In an embodiment of the first aspect of the present application, the method further includes: setting an index value after each ciphertext according to the chain sequence of the rainbow chain; wherein, when the index value is set in the rainbow chain, each index value is obtained by calculating the previous ciphertext through the following first formula, and each plaintext except the initial plaintext is obtained by calculating the previous index value:

[0010] I n =(D n +P n )mod S

[0011] Among them, I n is the nth index value in each rainbow chain, D n is a 64-bit number extracted from the previous ciphertext according to a preset digit interval, P n is the position of the current computing process in the rainbow chain, and S is the size of the password space.

[0012] In an embodiment of the first aspect of the present application, each plaintext except the initial plaintext is obtained by calculating its previous index value through the following second formula:

[0013]

[0014] Where P(i) is the position of the i-th character in the plaintext in the i-th mask item, I is the previous index value, and L(j) is the total number of characters in the character set corresponding to the j-th character in the mask.

[0015] In an embodiment of the first aspect of the present application, the header data also includes an expected hit rate; setting the first acquisition rule includes: according to the expected hit rate, combined with the length of the rainbow chain and the size of the password space, the number of rainbow chains is calculated according to the following formula:

[0016]

[0017] Among them, S is the size of the password space, R is the expected hit rate, L is the length of the rainbow chain, euc(i) is the expected number of non-repeating chains when the length of the rainbow chain is i, and euc(1) is the number of rainbow chains.

[0018] In an embodiment of the first aspect of the present application, simplified functions with different operation logics are used to perform operations on different positions of the same rainbow chain.

[0019] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer implements any of the methods described above.

[0020] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, it implements any of the methods described above.

[0021] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides a computer device, including a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement any of the methods described above.

[0022] As described above, the present application has the following beneficial effects:

[0023] The present application provides a mask-based rainbow table password cracking method, the steps of which include: obtaining header data, wherein the header data includes mask rules, hash functions, simplification functions and rainbow chain lengths; filtering the plaintext space according to the mask rules to obtain the corresponding password space, and generating a number of initial plaintexts based on the password space, calculating the chain data of the rainbow chain based on each initial plaintext, and then combining the header data to jointly generate a rainbow table to crack the target ciphertext. In the traditional rainbow table password cracking method, each password in the rainbow table is composed of a limited character set, which results in too many plaintext combinations obtained through rainbow table calculations and too large plaintext space. In the present invention, a mask is used to filter the plaintext space, only a part of the plaintext combinations with a higher password cracking rate is retained, and the plaintext combinations with a lower password cracking rate are deleted. Under the premise of the same amount of calculation and occupied space, the present invention has a better password cracking rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 Shown is a flowchart of a mask-based rainbow table password cracking method in one embodiment of the present application.

[0025] Figure 2 Shown is a schematic diagram of a rainbow chain structure in one embodiment of the present application.

[0026] Figure 3 Shown is a schematic diagram of a rainbow chain structure (including placeholder values) in one embodiment of the present application.

[0027] Figure 4 Shown is a schematic diagram of a rainbow chain structure (including index values) in one embodiment of the present application.

[0028] Figure 5 Shown is a schematic diagram of the structure of an electronic terminal in one embodiment of the present application. DETAILED DESCRIPTION

[0029] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0030] like Figure 1 As shown, the first aspect of the present application provides a mask-based rainbow table password cracking method, the steps of the method comprising:

[0031] S1: Obtain header data, wherein the header data includes a mask rule, a hash function, a simplification function, and a rainbow chain length.

[0032] It should be understood that the "password" and "ciphertext" in the present invention are the same concept, and are both used to refer to data obtained after plain text is encrypted.

[0033] It should be understood that in an embodiment of the first aspect of the present application, the mask rule includes the number of mask bits and the character set corresponding to each mask bit. The mask rule is a strategy used to simplify or constrain the password space. The mask rule reduces the demand for calculation and storage by limiting the position and range of certain characters in the password. Specifically, the mask rule can be defined in the following form:

[0034] For example, define ?l as lowercase character set; ?u as uppercase character set; ?d as numeric character set; ?h as hexadecimal lowercase character set; ?H as hexadecimal uppercase character set; ?s as special character set; ?a as mixed character set, which means it is composed of ?l lowercase character set, ?u uppercase character set, ?d numeric character set and ?s special character set:

[0035] ? l=abcdefghijklmnopqrstuvwxyz

[0036] ? u=ABCDEFGHIJKLMNOPQRSTUVWXYZ

[0037] ? d=0123456789

[0038] ? h=0123456789abcdef

[0039] ? H=0123456789ABCDEF

[0040] ? s=《space》! "#$%&'()*+,-. / :;<=>?@[\]^_`{|}~

[0041] ? a=? l? u? d? s

[0042] After defining the above character set, the mask rule can be defined as: ? l? l? l? d? d? d, that is, the ciphertext has a total of six characters, the first three characters are a character in the ? l lowercase character set, and the last three characters are a character in the ? d numeric character set.

[0043] Common forms of masking rules include fixed character positions, character set restrictions, position constraints, and predefined patterns. The fixed character position means that the masking rule can require certain positions of the ciphertext to contain specific characters. For example, it can be stipulated that the first character of the ciphertext is a letter, the last character is a number, and the middle character is a special symbol. The character set restriction means that the masking rule can limit the type of character set, such as numbers (0-9), uppercase letters (AZ), lowercase letters (az), special characters (!@#), etc. For example, the masking rule can define that the characters of the ciphertext can only be numbers and lowercase letters. The position constraint means that some masking rules can stipulate that only specific categories of characters can be used at specific positions in the ciphertext, for example, the first character is an uppercase letter, the second character is a number, the third character is a symbol, and so on. The predefined pattern means that the masking rule can also use a predefined pattern to constrain the construction of the ciphertext, for example, "?l" represents lowercase letters, "?d" represents numbers, and "?u" represents uppercase letters. Such a pattern makes the ciphertext space predictable and helps to generate hash values ​​in a targeted manner.

[0044] Since the plaintext space is the set of all possible ciphertexts, masking rules can narrow the set of ciphertexts that need to be processed by reducing the combination range of certain characters. For example, masking rules can stipulate that only numbers or letters can be used in certain positions of the ciphertext, thereby reducing the possible combinations during brute force cracking. In addition, by using masking rules, the efficiency of rainbow tables and brute force cracking can be greatly improved. For example, if it is known that the last character of the ciphertext is a number, the masking rule can be restricted to only consider numbers and ignore other character sets. Moreover, when the plaintext space is large, generating all possible ciphertext combinations and calculating their hash values ​​will consume a lot of time and storage space. Masking rules allow hashes to be generated for only part of the ciphertext, thereby reducing the number of hash values ​​that need to be stored.

[0045] A hash function is a function that maps ciphertext to an output value of a fixed size. In the process of generating a rainbow table, the role of the hash function is to "compress" the plaintext into a hash value. The basic working principle of a rainbow table is to pre-calculate the hash values ​​corresponding to a large number of plaintexts and their restoration process, so that the original plaintext corresponding to a hash value can be quickly "cracked" by searching the rainbow table later.

[0046] A reduction function usually refers to a function that can map ciphertext to plaintext according to a certain strategy. In the process of generating and using rainbow tables, the hash value needs to be inverted through the reduction function to "restore" the original ciphertext. It should be understood that the "recovery" here does not mean to infer the corresponding plaintext from the ciphertext (hash value), but refers to the set of operation results after the reduction function operation, that is, the set of plaintexts. Specifically, the plaintext P1 is calculated by the hash function to obtain the ciphertext Q1, and the ciphertext Q1 is calculated by the reduction function to obtain the plaintext Pn. Pn is not the same as P1.

[0047] The length of a rainbow chain refers to the number of elements contained in each rainbow chain. When generating a rainbow table, the ciphertext hash values ​​are connected in series according to certain rules to form a chain. The chain length determines the length of each chain, that is, the length of the chain formed after a series of hash and restore operations starting from an initial ciphertext. The length and number of rainbow chains are important parameters that affect the speed and efficiency of rainbow table searches. In the present invention, the length of a rainbow chain can be defined as the number of plaintexts in the chain, the number of ciphertexts in the chain, or the number of index values ​​in the chain.

[0048] S2: Filter the plaintext space according to the mask rule to obtain the corresponding password space.

[0049] It should be understood that after a larger plaintext space is filtered by the mask rule, the size of the password space obtained is the number of remaining plaintext combinations. The size S of the password space is the product of the size of the character set space for each bit of the mask. If the mask rule ? l? l? l? d? d? d is used to filter the plaintext space, the size of the password space obtained is

[0050] S=26*26*26*10*10*10=17576000.

[0051] S3: Obtain the number of rainbow chains according to a preset first acquisition rule.

[0052] Preferably, the header data also includes an expected hit rate; setting the first acquisition rule includes: according to the expected hit rate, combined with the length of the rainbow chain and the size of the password space, the number of rainbow chains is calculated according to the following formula:

[0053]

[0054] Among them, S is the size of the password space, R is the expected hit rate, L is the length of the rainbow chain, euc(i) is the expected number of non-repeating chains when the length of the rainbow chain is i, and euc(1) is the number of rainbow chains.

[0055] It should be understood that in some cases, the user may already know how many rainbow chains are needed, or the user wishes to manually control the number of rainbow chains. In this case, the number of rainbow chains may be directly obtained from the outside, such as obtaining the number of rainbow chains set by the user. Specifically, if the user may have already planned the resources for the attack, or hopes to use a fixed number of rainbow chains for cracking within a certain time and computing power range, the number of rainbow chains can be set directly by the user. This is usually suitable for situations where there is a clear time expectation for the cracking result. Alternatively, when storage and computing resources are limited, the user may choose a relatively small number of rainbow chains to reduce the computing and storage burden. Alternatively, when attacking certain hardware or devices, the resource limitations of the system or device may require the user to manually set the number of rainbow chains.

[0056] In other cases, the number of rainbow chains can be calculated by obtaining the expected hit rate. For example, when a user or attacker wants to optimize the attack strategy based on a given hit rate, the number of rainbow chains is usually calculated dynamically by setting the expected hit rate. This method is particularly suitable for scenarios where the attacker wants to achieve a certain cracking success rate. Alternatively, if the attacker is not sure how many rainbow chains are needed to achieve the expected success rate, the required number of rainbow chains can be calculated based on the expected hit rate, and the resource investment can be adjusted accordingly. In addition, the attacker can optimize the cracking process by adjusting the expected hit rate and other factors to ensure that the ideal cracking effect is achieved within limited time and computing resources.

[0057] S4: According to a preset second acquisition rule, a number of initial plaintexts equal to the number of the rainbow chains are obtained, so that a data set composed of all the initial plaintexts is a subset of the password space.

[0058] It should be understood that, in addition to the second acquisition rule, several plaintext combinations can be directly screened out from the password space as initial plaintexts.

[0059] S5: Generate a corresponding rainbow chain for each of the initial plaintexts according to the hash function, the simplification function and the length of the rainbow chain, and use the data at the head and the tail of the rainbow chain as the chain data; wherein the structure of the rainbow chain includes: the plaintext and the ciphertext are arranged alternately and the initial plaintext is set at the head of the chain, each subsequent ciphertext is obtained by applying a hash function to the previous plaintext, and each subsequent plaintext except the initial plaintext is obtained by applying a simplification function to the previous ciphertext.

[0060] like Figure 2 As shown in the figure, the structure of the rainbow chain is: the initial plaintext P0 is at the head of the chain, and the remaining plaintexts (P1 to P n ) is located in the middle and end of the chain. It is worth noting that the chain end data is set as plaintext P n Rather than the ciphertext Qn , because the plaintext P n After a hash operation, the ciphertext Q can be obtained n , that is, according to the plaintext P n That is, Q can be deduced one by one n , so we can use the plaintext P n Replace Q n And because the storage space occupied by plaintext data is smaller than that of ciphertext, storing the plaintext as the chain tail data in the rainbow table can reduce the storage space occupied, so P is used here. n Replace Q n Stored in the rainbow table. When the target ciphertext Q is obtained m When Q m Substitute the simplified function to get P (m+1) , P (m+1) The chain tail data P stored in the rainbow table n Compare the target ciphertext and then perform the next cracking work to find its corresponding plaintext Q m .

[0061] Preferably, Figure 3 As shown, the corresponding initial plaintext can also be generated according to the placeholder value, so that the set of initial plaintext is a subset of the password space, that is, the initial plaintext generated according to the placeholder value can cover part of the plaintext combination of the password space. Specifically: a number of placeholder values ​​equal to the number of the rainbow chain are randomly generated, and the placeholder value is modulo the size of the character set space corresponding to each bit mask to obtain the initial plaintext. And, in the case of the existence of a placeholder value, the placeholder value is set before the corresponding initial plaintext, that is, it replaces the first plaintext at the head position of the rainbow chain. Because the placeholder value is located at the head position of the rainbow chain, the chain data stored in the rainbow table is replaced by the original initial plaintext with the placeholder value. Since the range of the placeholder value is generally 0 to (S-1) (S is the size of the password space), the value range of the plaintext in the rainbow chain is often much larger than the placeholder value. Therefore, using the placeholder value to replace the initial plaintext stored in the rainbow table can save storage space.

[0062] It should be understood that obtaining the initial plaintext through placeholder values ​​is only one method of obtaining a partial plaintext combination from the password space. Other methods of obtaining the password space based on mask rule screening and obtaining a partial plaintext combination from the password space are also within the protection scope of the present invention.

[0063] Preferably, the method further comprises: setting an index value after each ciphertext according to the chain sequence of the rainbow chain; wherein, in the case where the index value is set in the rainbow chain, Figure 4As shown, each index value is obtained by calculating the previous ciphertext through the following first formula, and each plaintext except the initial plaintext is obtained by calculating the previous index value:

[0064] I n =(D n +P n )mod S

[0065] Among them, I n is the nth index value in each rainbow chain, D n is a 64-bit number extracted from the previous ciphertext according to a preset digit interval, P n is the position of the current computing process in the rainbow chain, and S is the size of the password space. n The last 64 digits of the previous ciphertext.

[0066] For example, suppose D n =0xA3F4C6789D2B14F6, which means the number extracted from the previous ciphertext; P n =7, indicating that the current calculation process is at step 4 in the rainbow chain; S = 100000, indicating the size of the password space. Then D n +P n D n +P n =0xA3F4C6789D2B14F6+7=0xA3F4C6789D2B14FD, and then perform a modulus operation on the result to obtain I n =98456.

[0067] Preferably, each plaintext except the initial plaintext is obtained by calculating its previous index value through the following second formula:

[0068]

[0069] Among them, P(i) is the position of the i-th character in the plaintext in the i-th mask item, I is the previous index value, and L(j) is the total number of characters corresponding to the j-th mask in the mask.

[0070] For example, suppose I = 98456 (the index value calculated by the first formula), i = 2 (we calculate the second character of the plaintext), L(i) = 26 (assuming the mask is ?l, the total number of characters corresponding to it is 26), and assuming the first bit of the mask is ?d, then L(1) is equal to 10. According to the index value I and the total number of characters corresponding to the mask L(1) and L(0), p(2) = 98456 / 10mod 26 = 17, and the character corresponding to it in the mask is r, that is, the second character in the plaintext is r. Thus, the index value can be mapped to the corresponding character in the mask.

[0071] At this time, the simplified function is the first formula plus the second formula, the first ciphertext is operated by the first formula to obtain the index value, and the index value is substituted into the second formula to obtain the subsequent plaintext.

[0072] For example, since the index value is the remainder obtained by taking the modulus of the password space size S of the previous ciphertext, the index value can only range from 0 to (S-1). And, assuming the mask rule is ? l? l? l? d? d? d (according to the above character set definition), the character set space size of each bit mask (from high to low) is: 26, 26, 26, 10, 10, 10. .

[0073] like Figure 4 As shown in the figure, in the rainbow chain containing index values, the chain tail data is the index value, not the plaintext or ciphertext. This is because the index value ranges from 0 to (S-1), and its value occupies a smaller storage space than the plaintext and ciphertext. Therefore, storing the index value as the chain tail data in the rainbow table can further save storage space. When the target ciphertext Q is obtained m After that, the target ciphertext is modulo the password space size S to obtain the corresponding index value I m , use I m Compare it with the chain tail data (index value) saved in the rainbow table, so as to perform the next step of cracking the target ciphertext and find its corresponding plaintext Q m .

[0074] S6: Generate a rainbow table using the header data and the chain data to crack the target ciphertext.

[0075] It should be understood that in an embodiment of the present invention including placeholder values ​​and index values, the process of decrypting the target ciphertext includes:

[0076] S61: Read the header data of the rainbow table.

[0077] S62: For the target ciphertext Q m Perform pre-calculation. The pre-calculation process includes:

[0078] S621: The target ciphertext Q m After taking the modulus of the password space size S, the corresponding index value I is obtained m .

[0079] S622: Repeat the rainbow table generation process and save the index value generated in each step. The rainbow table generation process is: take the placeholder value modulo the size S of the password space to obtain the initial plaintext, then use the hash function to calculate the initial plaintext to obtain the corresponding ciphertext, and take the ciphertext modulo the size of the character set space of each bit mask to obtain the corresponding index value. The number of repetitions of the rainbow table generation process is equal to the length of the rainbow table chain.

[0080] S63: Read the chain information in the rainbow table in sequence, and compare the chain tail (index value) in the chain information with each index value in the pre-calculated index list to determine whether the two index values ​​are equal.

[0081] S64: If, during the process of repeatedly generating the rainbow table, the index value at the end of the chain is not found to be equal to the pre-calculated index value, then the corresponding hash value has not been cracked by this rainbow table.

[0082] S65: If during the process of repeating the generation of the rainbow table, the index value of the chain tail is found to be equal to the index value generated by the pre-calculation, the chain head data corresponding to the chain tail data is found in the rainbow table, and the intermediate data of the rainbow chain is calculated step by step based on the chain head data: If the ciphertext calculated by the hash function in this process is consistent with the target ciphertext, the plaintext corresponding to the ciphertext is the plaintext corresponding to the target ciphertext, and the cracking is successful at this time, and the cracking is ended. If the ciphertext consistent with the target ciphertext is not found in this process, it indicates that this is a false alarm of the rainbow table, and the index value is replaced and the data in the rainbow chain corresponding to the index value is calculated until all chains in all rainbow tables are processed.

[0083] In an embodiment of the first aspect of the present application, simplified functions with different operation logics are used to perform operations on different positions in the same rainbow chain.

[0084] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer implements any of the methods described above.

[0085] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, it implements any of the methods described above.

[0086] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement any of the above-mentioned methods. Figure 5As shown, the computer device includes: at least one processor 501, a memory 502, at least one network interface 503 and a user interface 505. The various components in the device are coupled together through a bus system 504. It can be understood that the bus system 504 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 504 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as bus systems in Figure X.

[0087] The user interface 505 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.

[0088] It is understood that the memory 502 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.

[0089] The memory 502 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic terminal 500. Examples of these data include: any executable program used to operate on the electronic terminal 500, such as an operating system 5021 and an application 5022; the operating system 5021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 5022 can include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The XX method provided by the embodiment of the present invention can be included in the application 5022.

[0090] The method disclosed in the above embodiment of the present invention can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 501 or the instruction in the form of software. The above processor 501 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 501 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor 501 may be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0091] In an exemplary embodiment, the electronic terminal 500 may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD) to execute the aforementioned method.

[0092] It should be understood that the terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program and / or a computer. By way of illustration, both applications running on a computing device and a computing device can be components. One or more components may reside in a process and / or an execution thread, and a component may be located on a computer and / or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. Components may, for example, communicate through local and / or remote processes according to signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems through signals).

[0093] Those of ordinary skill in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0094] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0095] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0096] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0097] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0098] In the above embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When loading and executing computer program instructions (programs) on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. Available media may be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., high-density digital video discs (DVDs), or semiconductor media (e.g., solid state disks (SSDs), etc.).

[0099] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0100] It should be understood that in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially identical functions and effects. For example, the first XX and the second XX are only used to distinguish different XXs, and do not limit their order. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0101] It should be understood that in the embodiments of the present application, words such as "exemplary" or "for example" represent examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0102] It should be understood that in the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc or abc, where a, b, c can be single or multiple.

[0103] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0104] In summary, the present invention effectively overcomes various shortcomings of the prior art and has high industrial utilization value.

[0105] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A mask-based rainbow table password cracking method, characterized in that: The steps of the method include: Obtaining header data, wherein the header data includes a mask rule, a hash function, a reduction function, and a rainbow chain length; The plaintext space is screened according to the mask rule to obtain the corresponding password space; The number of rainbow chains is obtained according to the preset first acquisition rule; According to a preset second acquisition rule, a number of initial plaintexts equal to the number of the rainbow chains are obtained, so that a data set consisting of all the initial plaintexts is a subset of the password space; According to the hash function, the reduction function and the length of the rainbow chain, a corresponding rainbow chain is generated for each of the initial plaintexts, and the data at the head and the tail of the rainbow chain are used as chain data; wherein the structure of the rainbow chain includes: the plaintext and the ciphertext are arranged alternately and the initial plaintext is set at the head of the chain, each subsequent ciphertext is obtained by the previous plaintext after the hash function operation, and each subsequent plaintext except the initial plaintext is obtained by the previous ciphertext after the reduction function operation; The header data and the chain data are used to generate a rainbow table for cracking the target ciphertext.

2. A mask-based rainbow table password cracking method according to claim 1, characterized in that: The mask rule includes the number of mask bits and the character set corresponding to each mask bit.

3. A mask-based rainbow table password cracking method according to claim 2, characterized in that: The rainbow chain also includes placeholder values, and the step of obtaining a number of initial plaintexts equal to the number of rainbow chains according to a preset second acquisition rule includes: randomly generating a number of placeholder values ​​equal to the number of rainbow chains, and obtaining the initial plaintext by taking the placeholder values ​​modulo the size of the character set space corresponding to each bit mask; and setting the placeholder values ​​before the initial plaintext in the rainbow chain.

4. A mask-based rainbow table password cracking method according to claim 1, characterized in that: The method further comprises: According to the chain sequence of the rainbow chain, set the index value after each ciphertext; Wherein, in the case where the rainbow chain sets an index value, each index value is obtained by calculating the previous ciphertext using the following first formula, and each plaintext except the initial plaintext is obtained by calculating the previous index value: I n =(D n +P n )mod S Among them, I n is the nth index value in each rainbow chain, D n is a 64-bit number extracted from the previous ciphertext according to a preset digit interval, P n is the position of the current computing process in the rainbow chain, and S is the size of the password space.

5. A mask-based rainbow table password cracking method according to claim 4, characterized in that: The plaintexts other than the initial plaintext are obtained by calculating the previous index values ​​thereof through the following second formula: Where P(i) is the position of the i-th character in the plaintext in the i-th mask item, I is the previous index value, and L(j) is the total number of characters in the character set corresponding to the j-th character in the mask.

6. A mask-based rainbow table password cracking method according to claim 1, characterized in that: The header data also includes obtaining an expected hit rate; setting the first acquisition rule includes: according to the expected hit rate, combined with the length of the rainbow chain and the size of the password space, the number of rainbow chains is calculated according to the following formula: Among them, S is the size of the password space, R is the expected hit rate, L is the length of the rainbow chain, euc(i) is the expected number of non-repeating chains when the length of the rainbow chain is i, and euc(1) is the number of rainbow chains.

7. A mask-based rainbow table password cracking method according to claim 1, characterized in that: Different positions of the same Rainbow Chain are operated using simplified functions with different operation logics.

8. A computer program product, characterized in that The computer program product includes computer program code, and when the computer program code is executed on a computer, the computer is enabled to implement the method as described in any one of claims 1 to 7.

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

10. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method according to any one of claims 1 to 7.