A password cracking method and device, and an electronic device

By combining bitmap technology and parallel computing, the problem of low efficiency in cracking large batches of hash values ​​is solved, achieving efficient hash value processing that is suitable for hash ciphertexts of various lengths.

CN115329318BActive Publication Date: 2026-06-05CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2022-08-16
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies are inefficient in cracking large batches of hash values ​​and cannot effectively utilize computing resources. In particular, tools for cracking single hash values ​​are inefficient when processing large batches of hash values.

Method used

Bitmap technology is used to split and map hash values. Combined with parallel computing, the mapping relationship between hash values ​​and passwords is established through bitmap masks and index numbers. The parallel computing capabilities of GPUs are used to improve cracking efficiency.

Benefits of technology

It significantly improves the efficiency of cracking large batches of hash values, reduces storage space requirements, is suitable for hash ciphertexts of different lengths, and enhances computational performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115329318B_ABST
    Figure CN115329318B_ABST
Patent Text Reader

Abstract

The application discloses a password cracking method and device and electronic equipment, and the method comprises the following steps: applying for a memory space for a first hash value to be cracked and determining the number of bitmap spaces according to the byte number of the first hash value; splitting the first hash value based on the byte number to obtain a first digest set, and obtaining the index number of the bitmap corresponding to each digest in the first digest set and the value corresponding to each digest based on a preset rule and a bitmap mask; establishing a mapping relationship between the digest and the corresponding bitmap based on the index number and the value, and generating a bitmap mapping table of the first hash value based on the mapping relationship; judging whether a second hash value corresponding to a password to be verified exists in the bitmap mapping table based on a second index number and a second value of the second hash value; and determining whether the password to be verified is the accurate password of the first hash value based on the judgment result. Thus, the problem of low cracking efficiency for a large number of hashes is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of password cracking technology, and in particular to a password cracking method, apparatus, and electronic device. Background Technology

[0002] Password cracking methods are diverse, with brute-force being a universal approach suitable for all algorithms. This computationally intensive method has its own characteristics, and there are many ways to accelerate the computation. Brute-force, also known as exhaustive cracking, involves the cracker exhaustively searching for all possible combinations of characters in the password and testing them one by one. It's a widely used key-breaking technique that can be performed without knowing any user information. This method is inefficient and time-consuming, but theoretically has a high success rate, potentially reaching 100%. However, in practical applications, this is impossible due to the limitations of host computing speed. For example, an eight-digit password using letters, numbers, and some special characters can have over 600 trillion combinations; with current computing power, completely cracking it would take a very long time.

[0003] Currently, there is a lot of research on accelerating brute-force attacks both domestically and internationally, and a few usable tools have emerged. These tools maintain high speed and efficiency for cracking single hash values, but are inefficient for cracking large batches of hashes. Summary of the Invention

[0004] The purpose of this application is to provide a password cracking method, apparatus, and electronic device to solve the problem of low efficiency in cracking large batches of hash values.

[0005] In a first aspect, embodiments of this application provide a password cracking method, the method comprising:

[0006] Memory space is allocated for the first hash value to be cracked, and the number of bitmap spaces is determined according to the number of bytes of the first hash value, wherein the number of bytes is equal to the number of bitmap spaces;

[0007] The first hash value is split based on the number of bytes to obtain a first digest set. Based on preset rules and a bitmap mask, the index number of the bitmap corresponding to each digest in the first digest set and the value corresponding to each digest are obtained. The bitmap mask is a variable that represents the position of a valid bit in the bitmap.

[0008] A mapping relationship between the digest and the corresponding bitmap is established based on the index number and the value, and a bitmap mapping table of the first hash value is generated based on the mapping relationship;

[0009] For any password to be verified, based on the second index number and second value of the second hash value corresponding to the password to be verified, it is determined whether the second hash value exists in the bitmap mapping table; and based on the determination result, it is determined whether the password to be verified is the exact password of the first hash value.

[0010] In some possible embodiments, after generating a bitmap mapping table for the first hash value based on the mapping relationship, the method further includes:

[0011] If the number of the first hash values ​​is greater than or equal to the value represented by the bitmap mask, and the number exceeds a threshold, then the number of bits in the bitmap is increased so that the value represented by the bitmap mask corresponding to the bitmap with the increased number of bits is greater than or equal to the number.

[0012] The threshold is determined based on the number of the first hash values.

[0013] In some possible embodiments, based on preset rules and a bitmap mask, each digest in the first digest set is used to represent the index number of the bitmap corresponding to the digest and the value corresponding to the digest, including:

[0014] For any digest in the digest set, the digest and a preset value are converted to binary and then ANDed to determine the shift bits; based on the shift bits, a left shift operation is performed on the first preset value converted to binary to obtain the value; and

[0015] The index number is obtained by right-shifting the binary value corresponding to the digest by a set number of bits and performing a bitwise AND operation between the set value and the binary value corresponding to the bitmap mask.

[0016] In some possible embodiments, determining whether the second hash value exists in the bitmap mapping table based on the second index number and the second value of the second hash value corresponding to the password to be verified includes:

[0017] The second hash value is split based on the number of bytes to obtain a second digest set, and a second index number representing the bitmap corresponding to the digest and a second value corresponding to the digest are obtained in the second digest set based on the preset rules and bitmap mask.

[0018] For any summary in the second summary set, if the second index number corresponding to the summary exists in the bitmap mapping table with a corresponding first index number, then the second value corresponding to the summary and the first value corresponding to the first index number are calculated.

[0019] If the calculation result of each digest in the second digest set is non-zero, the password to be verified is determined to be the password corresponding to the first hash value.

[0020] In some possible embodiments, the number of bitmap entries is a value obtained by left-shifting a second preset value converted to binary by a fixed number of bits, wherein the fixed number of bits is the number of bits in the bitmap;

[0021] The value represented by the bitmap mask is the number of bitmap entries minus a fixed value.

[0022] Secondly, embodiments of this application provide a password cracking device, the device comprising:

[0023] The determining module is used to allocate memory space for the first hash value to be cracked and determine the number of bitmap spaces based on the number of bytes of the first hash value, wherein the number of bytes is equal to the number of bitmap spaces;

[0024] The acquisition module is used to split the first hash value based on the number of bytes to obtain a first digest set, and based on preset rules and a bitmap mask, obtain the index number of the bitmap corresponding to each digest in the first digest set and the value corresponding to each digest; wherein, the bitmap mask is a variable representing the position of the effective bits in the bitmap;

[0025] The generation module is used to establish a mapping relationship between the digest and the corresponding bitmap based on the index number and the value, and to generate a bitmap mapping table for the first hash value based on the mapping relationship;

[0026] The judgment module is used to determine, for any password to be verified, whether the second hash value exists in the bitmap mapping table based on the second index number and the second value of the second hash value corresponding to the password to be verified; and to determine whether the password to be verified is the exact password of the first hash value based on the judgment result.

[0027] Thirdly, embodiments of this application provide an electronic device, including 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, the instructions being executed by the at least one processor to enable the at least one processor to perform the password cracking method provided in the first aspect above.

[0028] Fourthly, embodiments of this application provide a computer storage medium storing a computer program for causing a computer to execute the password cracking method provided in the first aspect.

[0029] In order to solve the problem of low efficiency in cracking large batches of hash values, this application proposes a storage scheme for large batches of hash values ​​(i.e., the first hash value mentioned above) based on bitmaps, which can significantly reduce the storage space of hash values ​​and improve performance; it combines the advantages of bitmaps and parallel computing, which significantly improves the efficiency of password cracking; and it provides a framework for cracking passwords of large batches of hash values, which has good versatility and is applicable to hash ciphertexts of different lengths.

[0030] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0031] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a flowchart illustrating a password cracking method according to an embodiment of this application;

[0033] Figure 2 This is a schematic diagram of a bitmap generation process according to an embodiment of this application;

[0034] Figure 3 This is a schematic diagram illustrating a GPU port command cracking process according to an embodiment of this application;

[0035] Figure 4 This is a schematic diagram of a password cracking device according to an embodiment of this application;

[0036] Figure 5 This is a schematic diagram of an electronic device structure according to an embodiment of this application. Detailed Implementation

[0037] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0038] In the description of the embodiments of this application, unless otherwise stated, the term "multiple" refers to two or more, and other quantifiers are similarly understood. The preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.

[0039] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on conventional or non-inventive effort. For steps that do not logically have a necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual processing or when the control device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.

[0040] Currently, there is a considerable amount of research both domestically and internationally on accelerating brute-force password cracking, and a small number of usable tools have emerged. Major tools include John the Ripper and EDPR (Elcomsoft Distributed Password Recovery). John the Ripper, as a CPU (Central Processing Unit) based password cracking tool, supports the vast majority of current encryption algorithms and is optimized for different CPU instruction sets, making it the fastest running software among CPU-based tools. John the Ripper has a high CPU utilization rate and is primarily used on dedicated machines or when the system is idle. The official website does not provide distributed scaling support, and unofficial distributed computing solutions have significant shortcomings.

[0041] EDPR is a commercial cryptography cracking software that provides dual support for both CPUs and GPUs (Graphics Processing Units). It only runs on Windows platforms and primarily supports cracking software programs and hash files. EDPR offers excellent distributed computing performance, consisting of a server and self-connecting clients, enabling efficient collaborative computing within a local area network. EDPR optimizes host resources and network bandwidth, uses encrypted transmission for all communication, and provides plug-in support for cryptographic algorithms.

[0042] Raven is a JavaScript-based distributed cryptographic computation system that can brute-force cryptographic algorithms by distributing tasks across multiple browser clients. As a browser-based program, Raven boasts excellent cross-platform compatibility, but only supports CPU processors. Currently, it can crack mainstream algorithms such as MD5 and SHA1. Its server is implemented via a web application, requiring minimal network bandwidth and allowing for easy deployment over wide area networks. Communication uses the simple HTTP protocol, and plugin support is not detailed. In summary, the aforementioned software maintains high speed and efficiency in cracking single hash values, but suffers from low efficiency when cracking large batches of hash values. This application proposes a password cracking method, apparatus, and electronic device that can effectively reduce the storage space required for large batches of hash values, thereby improving data transmission efficiency.

[0043] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.

[0044] The password cracking method in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0045] Figure 1 This application provides a schematic flowchart of a password cracking method according to an embodiment, including:

[0046] Step 101: Allocate memory space for the first hash value to be cracked and determine the number of bitmap spaces based on the number of bytes of the first hash value, wherein the number of bytes is equal to the number of bitmap spaces.

[0047] The first hash value is the large batch of hash values ​​that need to be cracked. Read the large batch of hash values ​​to be cracked, calculate the number of the first hash values ​​and define it as hash_num, allocate the corresponding memory space in the CPU, and read the large batch of first hash values ​​into the CPU memory.

[0048] Assuming the first hash value is 4 bytes, four unsigned int bitmap spaces are allocated in the CPU. In this application, the four bitmap spaces are defined as bitmap_a, bitmap_b, bitmap_c, and bitmap_d, and the size of each bitmap space is 2^24. The `sizeof(unsigned int)` method generates n bitmap spaces, each with a size of 2^24, if the first hash value is n bytes long. sizeof(unsigned int).

[0049] This application includes, but is not limited to, a bitmap-based password cracking algorithm for GPUs. GPU technology is maturing rapidly, and programmable image processors have become the mainstay of computing technology. Their performance is tens or even hundreds of times that of CPUs, making GPUs the most powerful computing devices available today, challenging and surpassing the CPU's dominance and fundamentally changing the face of the computing industry. GPUs possess powerful computing capabilities, and their architecture is specifically optimized for massively parallel processing cores. Unlike CPUs, GPUs have a multi-threaded, large-scale parallel throughput architecture. Parallelizing computationally intensive and data-independent algorithms on the GPU platform, utilizing the multi-threaded, single-instruction GPU architecture of the developed software to improve speed, and applying the GPU architecture to parallel computing achieves a better speedup ratio, thereby improving computing power.

[0050] With the increasing volume of computational data, how to utilize storage space more efficiently has become a challenge. Bitmap technology is a typical data structure compression technique, widely used in classic routing lookup, packet classification, and pattern matching algorithms. Combined with continuously updated hardware features, such as large-capacity caches and high-speed on-chip memory, and improvements to the algorithm's data structure, significant performance gains can often be achieved. This application establishes a method based on parallel computing and bitmap theory, capable of cracking large batches of hash values.

[0051] Step 102: Based on the number of bytes, the first hash value is split to obtain a first digest set, and based on preset rules and a bitmap mask, the index number of the bitmap corresponding to each digest in the first digest set and the value corresponding to each digest are obtained; wherein, the bitmap mask is a variable representing the position of the effective bits in the bitmap.

[0052] Specifically, a bitmap is generated using the first hash value in the hash table. Four bytes (32 bits) of data from the first hash value are read and the first hash value is split to obtain a first digest set. The first digest set includes four digests. In this application, the four digests are defined as digest[0], digest[1], digest[2], and digest[3], respectively. The corresponding values ​​of the four digests are defined as val0, val1, val2, and val3, and the corresponding index numbers of the four digests are defined as idx0, idx1, idx2, and idx3.

[0053] In step 101, after determining the number of bitmap spaces, the bitmap is generated. The number of bits in the bitmap starts from 16 bits. In the generated bitmap, the relevant variables of the bitmap are defined, specifically bitmap_bits (number of bits), bitmap_nums (number of entries), bitmap_mask (mask), and bitmap_size (size).

[0054] As an optional implementation, the number of bitmap entries is a value obtained by left-shifting a second preset value converted to binary by a fixed number of bits, wherein the fixed number of bits is the number of bits in the bitmap; the value represented by the bitmap mask is the number of bitmap entries minus the fixed value.

[0055] Specifically, in this application, the second preset value is 1, which is fixed at 1, that is, the number of bitmap entries bitmap_nums = 1 << bitmap_bits, where "<<" indicates left shift; the bitmap mask bitmap_mask = bitmap_nums – 1; bitmap_size = bitmap_nums sizeof(unsigned int).

[0056] As an optional implementation, for obtaining each digest in the first digest set based on preset rules and bitmap masks to represent the index number of the bitmap corresponding to the digest and the value corresponding to the digest, the following methods are included:

[0057] For any digest in the digest set, the digest and a preset value are converted to binary and then ANDed to determine the shift bits; based on the shift bits, a left shift operation is performed on the first preset value converted to binary to obtain the value; and

[0058] The index number is obtained by right-shifting the binary value corresponding to the digest by a set number of bits and performing a bitwise AND operation between the set value and the binary value corresponding to the bitmap mask.

[0059] For obtaining the value of the digest, this application sets the value to 0x1f (hexadecimal), and the first preset value is 1. Taking digest[0] as an example, digest[0] is processed by 1<<( digest[0]&0x1f) to obtain the value of digest[0]. The following example explains this formula. Suppose that digest[0] is 11111111 in binary and 0x1f is 00011111 in binary. digest[0]&0x1f=11111111&00011111=00011111; 00011111 is 31 in decimal. That is, we need to shift 1 left by 31 bits. Then, we need to convert 1 to binary. Since 1 is defaulted to unsigned int, 1 is 32 bits in binary. So, 1 is 000...1 (1 has 31 zeros in front of it). Shifting 1 left by 31 bits gives the value of digest[0] as 100...00 (1 has 31 zeros in front of it).

[0060] For the index number of the digest, this application sets the number of bits to 5. Taking digest[0] as an example, digest[0] is processed by (digest[0]>>5)& bitmap_mask to obtain the index number idx0 of digest[0]. The following is an explanation of this formula with a specific example. Suppose that digest[0] is 11111111 after being converted to binary. 11111111 is shifted right by 5 bits to get 00000111. The bitmap_mask is 15 ones. Then (digest[0]>>5)& bitmap_mask=00000111&15 ones. The final result is the index number idx0, which is 000...0111 (with 12 zeros at the beginning).

[0061] Step 103: Establish a mapping relationship between the digest and the corresponding bitmap based on the index number and the value, and generate a bitmap mapping table for the first hash value based on the mapping relationship.

[0062] Specifically, the mapping relationship is represented by the correspondence between the index number and value of the digest and the bitmap corresponding to the digest. When a hash value is 4 bytes, the hash value is split into 4 digests digest[0], digest[1], digest[2], and digest[3]. Each digest corresponds to a bitmap. The mapping relationship of the bitmaps of the hash value is the correspondence between each bitmap and the value and index number of its corresponding digest. First, the bitmap mapping of bitmap_a corresponding to digest[0] is obtained. The same method is used to map bitmap_b, bitmap_c, and bitmap_d to digest[1], digest[2], and digest[3] respectively to obtain the bitmap mapping table of the hash value. The above step 103 is repeated until each hash value in the first hash value is mapped to 4 bitmaps.

[0063] See Figure 2 The diagram illustrates the bitmap generation process. The batch of hash value files represents the first hash value mentioned above. Assuming that corresponding memory space is allocated in the CPU, and a large batch of first hash values ​​are read into the CPU memory, "e10adc3949ba59ab..." in the diagram represents a hash value read. The first hash value is split to obtain the first digest set, and the value and index number idx value corresponding to each digest are obtained. For example, "bitmap_a[idx0]=val0" means that in bitmap bitmap_a, the value corresponding to index number idx0 is val0. The mapping relationship is established, and finally bitmaps bitmap_a, bitmap_b, bitmap_c, and bitmap_d are generated.

[0064] As an optional implementation, after generating the bitmap mapping table of the first hash value based on the mapping relationship, the method further includes:

[0065] If the number of the first hash values ​​is greater than or equal to the value represented by the bitmap mask, and the number exceeds a threshold, then the number of bits in the bitmap is increased so that the value represented by the bitmap mask corresponding to the bitmap with the increased number of bits is greater than or equal to the number.

[0066] The threshold is determined based on the number of the first hash values.

[0067] Specifically, the number of first hash values ​​(hash_num) is compared with the size of the value represented by the bitmap mask (bitmap_mask). If hash_num is greater than or equal to bitmap_mask, it is determined that there are multiple abnormal first hash values ​​in the generated bitmap that share the same bit position, which is an abnormal result.

[0068] The number exceeding the preset threshold includes incrementing the bit depth of the bitmap by 1 if the number of anomalous hash values ​​with duplicate positions in the generated bitmap exceeds half the total number of first hash values, until the value represented by the bitmap mask corresponding to the bitmap with the increased bit depth is greater than or equal to the number.

[0069] See Figure 3 The diagram shown illustrates the GPU port password cracking process. After the bitmap is generated, it is copied from the CPU to the GPU memory. The GPU startup parameters are set, and the password generation calculation is performed in parallel on the GPU.

[0070] Step 104: For any password to be verified, based on the second index number and second value of the second hash value corresponding to the password to be verified, determine whether the second hash value exists in the bitmap mapping table; and based on the determination result, determine whether the password to be verified is the exact password of the first hash value.

[0071] Specifically, the password to be verified is pre-set, which can be understood as another input. For any password to be verified, it is necessary to verify whether the password to be verified is the exact password of the first hash value.

[0072] As an optional implementation, determining whether the second hash value exists in the bitmap mapping table based on the second index number and second value of the second hash value corresponding to the password to be verified includes:

[0073] The second hash value is split based on the number of bytes to obtain a second digest set, and a second index number representing the bitmap corresponding to the digest and a second value corresponding to the digest are obtained in the second digest set based on the preset rules and bitmap mask.

[0074] For any summary in the second summary set, if the second index number corresponding to the summary exists in the bitmap mapping table with a corresponding first index number, then the second value corresponding to the summary and the first value corresponding to the first index number are calculated.

[0075] If the calculation result of each digest in the second digest set is non-zero, the password to be verified is determined to be the password corresponding to the first hash value.

[0076] Specifically, in each thread, the password to be verified is used to generate a second hash value according to the corresponding algorithm. Assuming the second hash value is 4 bytes, the 4 bytes (32 bits) of the second hash value are split to obtain the second digest set, which includes: g_digest[0], g_digest[1], g_digest[2], and g_digest[3]. The preset rules are described in the relevant description in step 102 above, and will not be repeated here. That is, g_digest[0] is processed by 1<<( g_digest[0]&0x1f) to obtain the second value of g_digest[0]. g_digest[0] is processed by ( g_digest[0]>>5)& bitmap_mask to obtain the second index number of g_digest[0]. The same method is used to calculate digest[1], digest[2], and digest[3] to obtain the second value and second index number corresponding to each digest.

[0077] For any digest in the second digest set, if the second index number corresponding to the digest exists in the bitmap mapping table with a corresponding first index number, a bitwise AND operation is performed between the second value corresponding to the digest and the first value corresponding to the first index number. The result is either 0 or non-zero. This bitwise AND operation is performed on each digest in the second digest set. If all results are non-zero, the password to be verified is determined to be the password corresponding to the first hash value, meaning the password to be verified is a plaintext corresponding to one of the first hash values ​​in the batch, and is therefore a correct password. If any value is 0, it means the password to be verified is not a plaintext corresponding to one of the first hash values ​​in the batch.

[0078] This application proposes a storage scheme for large-scale hash values ​​(i.e., the first hash value mentioned above) based on bitmaps, which can significantly reduce the storage space of hash values ​​and improve performance; it combines the advantages of bitmaps and parallel computing, significantly improving the efficiency of password cracking; and it provides a framework for password cracking of large-scale hash values, which has good versatility and is applicable to hash ciphertexts of different lengths.

[0079] Example 2

[0080] Based on the same inventive concept, this application also provides a password cracking device, such as... Figure 4 As shown, the device includes:

[0081] The determining module 401 is used to allocate memory space for the first hash value to be cracked and determine the number of bitmap spaces according to the number of bytes of the first hash value, wherein the number of bytes is equal to the number of bitmap spaces;

[0082] The acquisition module 402 is used to split the first hash value based on the number of bytes to obtain a first digest set, and to obtain the index number of the bitmap corresponding to each digest in the first digest set and the value corresponding to each digest based on preset rules and a bitmap mask; wherein, the bitmap mask is a variable representing the position of a valid bit in the bitmap;

[0083] The generation module 403 is used to establish a mapping relationship between the digest and the corresponding bitmap based on the index number and the value, and to generate a bitmap mapping table of the first hash value based on the mapping relationship;

[0084] The judgment module 404 is used to determine, for any password to be verified, whether the second hash value exists in the bitmap mapping table based on the second index number and the second value of the second hash value corresponding to the password to be verified; and to determine whether the password to be verified is the exact password of the first hash value based on the judgment result.

[0085] Optionally, the generation module 403 is also used to,

[0086] If the number of the first hash values ​​is greater than or equal to the value represented by the bitmap mask, and the number exceeds a threshold, then the number of bits in the bitmap is increased so that the value represented by the bitmap mask corresponding to the bitmap with the increased number of bits is greater than or equal to the number.

[0087] The threshold is determined based on the number of the first hash values.

[0088] Optionally, the acquisition module 402 is specifically used for,

[0089] For any digest in the digest set, the digest and a preset value are converted to binary and then ANDed to determine the shift bits; based on the shift bits, a left shift operation is performed on the first preset value converted to binary to obtain the value; and

[0090] The index number is obtained by right-shifting the binary value corresponding to the digest by a set number of bits and performing a bitwise AND operation between the set value and the binary value corresponding to the bitmap mask.

[0091] Optionally, the judgment module 404 is specifically used to split the second hash value based on the number of bytes to obtain a second digest set, and to obtain a second index number representing the bitmap corresponding to the digest and a second value corresponding to the digest in the second digest set based on the preset rules and the bitmap mask;

[0092] For any summary in the second summary set, if the second index number corresponding to the summary exists in the bitmap mapping table with a corresponding first index number, then the second value corresponding to the summary and the first value corresponding to the first index number are calculated.

[0093] If the calculation result of each digest in the second digest set is non-zero, the password to be verified is determined to be the password corresponding to the first hash value.

[0094] Optionally, the number of bitmap entries is a value obtained by left-shifting a second preset value converted to binary by a fixed number of bits, wherein the fixed number of bits is the number of bits in the bitmap;

[0095] The value represented by the bitmap mask is the number of bitmap entries minus a fixed value.

[0096] Having introduced the password cracking method and apparatus according to exemplary embodiments of this application, we will now introduce an electronic device according to another exemplary embodiment of this application.

[0097] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0098] In some possible implementations, the electronic device according to this application may include at least one processor and at least one memory. The memory stores program code that, when executed by the processor, causes the processor to perform the steps of the password cracking methods according to various exemplary embodiments of this application described above.

[0099] The following reference Figure 5 This application describes an electronic device 130 according to this embodiment, namely the aforementioned password cracking device. Figure 5 The electronic device 130 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0100] like Figure 5 As shown, the electronic device 130 is presented in the form of a general electronic device. The components of the electronic device 130 may include, but are not limited to: at least one processor 131, at least one memory 132, and a bus 133 connecting different system components (including memory 132 and processor 131).

[0101] Bus 133 represents one or more of several bus structures, including a memory bus or memory controller, peripheral bus, processor, or local bus using any of the various bus structures.

[0102] The memory 132 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 1321 and / or cache memory 1322, and may further include read-only memory (ROM) 1323.

[0103] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0104] Electronic device 130 can also communicate with one or more external devices 134 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable a user to interact with electronic device 130, and / or with any device that enables electronic device 130 to communicate with one or more other electronic devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 135. Furthermore, electronic device 130 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 136. As shown, network adapter 136 communicates with other modules used in electronic device 130 via bus 133. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0105] In some possible implementations, various aspects of the password cracking method provided in this application can also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to cause the computer device to perform the steps of the password cracking method according to the various exemplary embodiments of this application described above.

[0106] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0107] The monitoring program product of the embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on an electronic device. However, the program product of this application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0108] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0109] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0110] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's electronic device, partially on the user's device, as a standalone software package, partially on the user's electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In cases involving remote electronic devices, the remote electronic device can be connected to the user's electronic device via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external electronic device (e.g., via the Internet using an Internet service provider).

[0111] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0112] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0113] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0114] This application is described with reference to flowchart illustrations and block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block and / or segment of the flowchart illustrations and block diagrams, as well as combinations of blocks and segments in the flowchart illustrations and block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and boxes Figure 1 The function specified in one or more boxes.

[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and boxes Figure 1 The steps of the function specified in one or more boxes.

[0117] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0118] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A password cracking method applied to a CPU, characterized in that, The method includes: Memory space is allocated for the first hash value to be cracked, and the number of bitmap spaces is determined according to the number of bytes of the first hash value, wherein the number of bytes is equal to the number of bitmap spaces; The first hash value is split based on the number of bytes to obtain a first digest set; For any digest in the first digest set, the digest and a set value are converted into binary and then ANDed to determine the shift bits; based on the shift bits, the first preset value converted into binary is left-shifted to obtain the value; and based on the set value obtained by right-shifting the binary value corresponding to the digest by a set number, the set value and the binary value corresponding to the bitmap mask are ANDed to obtain the index number; wherein, the bitmap mask is a variable representing the position of a valid bit in the bitmap; A mapping relationship between the digest and the corresponding bitmap is established based on the index number and the value, and a bitmap mapping table of the first hash value is generated based on the mapping relationship; For any password to be verified, the second hash value corresponding to the password to be verified is split based on the number of bytes to obtain a second digest set, and the second index number used to represent the bitmap corresponding to the digest and the second value corresponding to the digest are obtained in the second digest set based on preset rules and bitmap mask; For any summary in the second summary set, if the second index number corresponding to the summary has a corresponding first index number in the bitmap mapping table, then the second value corresponding to the summary and the first value corresponding to the first index number are calculated. If the calculation result of each digest in the second digest set is non-zero, the password to be verified is determined to be the password corresponding to the first hash value; Based on the judgment result, it is determined whether the password to be verified is the accurate password of the first hash value.

2. The method according to claim 1, characterized in that, After generating the bitmap mapping table for the first hash value based on the mapping relationship, the method further includes: If the number of the first hash values ​​is greater than or equal to the value represented by the bitmap mask, and the number exceeds a threshold, then the number of bits in the bitmap is increased so that the value represented by the bitmap mask corresponding to the bitmap with the increased number of bits is greater than or equal to the number. The threshold is determined based on the number of the first hash values.

3. The method according to claim 1 or 2, characterized in that, After determining the number of bitmap spaces, the method further includes: Generate a bitmap and define the relevant variables of the bitmap, including the number of bits in the bitmap, the number of bitmap entries, the bitmap mask, and the size of the bitmap; The number of bitmap entries is obtained by left-shifting the second preset value by the number of bits in the bitmap, using the second preset value as a base. The value represented by the bitmap mask is the number of bitmap entries minus a fixed value.

4. A password cracking device, characterized in that, The device includes: The determining module is used to allocate memory space for the first hash value to be cracked and determine the number of bitmap spaces based on the number of bytes of the first hash value, wherein the number of bytes is equal to the number of bitmap spaces; The acquisition module is configured to split the first hash value based on the number of bytes to obtain a first digest set; for any digest in the first digest set, convert the digest and a preset value into binary and perform an AND operation to determine the shift bits; and based on the shift bits, perform a left shift operation on the first preset value converted into binary to obtain a value; and based on the preset value obtained by right shifting the binary value corresponding to the digest by a preset number of bits, perform an AND operation on the preset value and the binary value corresponding to the bitmap mask to obtain an index number; wherein, the bitmap mask is a variable representing the position of a valid bit in the bitmap; The generation module is used to establish a mapping relationship between the digest and the corresponding bitmap based on the index number and the value, and to generate a bitmap mapping table for the first hash value based on the mapping relationship; The judgment module is used to, for any password to be verified, split the second hash value corresponding to the password to be verified based on the number of bytes to obtain a second digest set, and obtain the second index number representing the bitmap corresponding to the digest and the second value corresponding to the digest in the second digest set based on preset rules and bitmap mask; for any digest in the second digest set, if the second index number corresponding to the digest has a corresponding first index number in the bitmap mapping table, then calculate the second value corresponding to the digest and the first value corresponding to the first index number; if the calculation result of each digest in the second digest set is non-zero, determine that the password to be verified is the password corresponding to the first hash value; and determine whether the password to be verified is the exact password of the first hash value based on the judgment result.

5. The apparatus according to claim 4, characterized in that, The generation module is also used for, If the number of the first hash values ​​is greater than or equal to the value represented by the bitmap mask, and the number exceeds a threshold, then the number of bits in the bitmap is increased so that the value represented by the bitmap mask corresponding to the bitmap with the increased number of bits is greater than or equal to the number. The threshold is determined based on the number of the first hash values.

6. An electronic device, characterized in that, The method 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 to enable the at least one processor to perform the method as described in any one of claims 1-3.

7. A computer storage medium, characterized in that, The computer storage medium stores a computer program that enables the computer to perform the method as described in any one of claims 1-3.