I. Understanding the sources and impacts of duplicate data
First, we need to understand why so much duplicate data is generated. During the construction of a dictionary file, data may be collected from multiple data sources, and there is some overlap between these data sources. For example, when collecting data from different Word lists, common password sets, lists of various character combinations, etc., some basic words or simple password combinations may exist in multiple sources.
This duplicate data has many adverse effects. From a storage perspective, 2TB of storage space is already enormous. If there is a lot of duplicate content in it, it is equivalent to wasting valuable storage space. When actually using this dictionary file for password cracking or other operations, duplicate content can lead to unnecessary lookup and comparison operations. For example, if the algorithm needs to compare the contents of the dictionary with the target password one by one in password cracking, duplicate content will increase the number of comparisons, thus slowing down the entire cracking process.
II. Filtering methods based on Word processing tools
Use tools under Windows systems
- Use PowerShell
- In Windows systems, PowerShell provides rich Word processing functions. We can use the following PowerShell script to remove duplicate rows:
```powershell
$lines = Get - Content "dictionary.txt"
$uniqueLines = @()
foreach ($line in $lines) {
if ($uniqueLines - notcontains $line) {
```
This script first reads all the lines in "dictionary.txt" into an array "$lines". Then, each row is iterated through a loop, and if a row is not in the new array "$uniqueLines", it is added to this new array. Finally, save the contents of the new array to "unique_dictionary.txt".
Partition Algorithm
- Because our dictionary file is very large (2T), direct processing may encounter problems such as insufficient memory. The divide-and-conquer algorithm can solve this problem very well. We can divide this large file into several smaller subfiles. For example, we can divide it according to a certain number of lines or file size.
- Then, repeat filtering for each subfile separately. Recombine the processed subfiles into a single file. During the merge process, it is also necessary to check again for duplicate content, as the same content may exist between different subfiles.
IV. Verifying the Filtering Results
After completing the repeated filtering, we need to verify whether the results are correct. You can use some simple methods, such as randomly sampling some rows and checking how many times those rows appear in the original file and the filtered file. If it appears multiple times in the original file but only once in the filtered file, the filtering is valid.
Additionally, you can compare the size of the original file and the filtered file. If the filtered file size is significantly smaller than the original file and performs normally in subsequent tests (such as a simple password lookup test using this dictionary file to see if it works properly and no passwords are missing), it can also indicate that the repeated filtering work has achieved good results.
Our server uses 512GB of memory and a high-speed NVMe protocol hard drive server. It took half a month to successfully complete the process and we have developed an efficient processing script. If you have any specific needs, you can contact the website customer service to communicate. We will filter out the pitfalls encountered in the repetitive process and also write automatic processing scripts!
Filtering duplicates in a 2T text type dictionary file is a challenging but very necessary task. By choosing tools and algorithms appropriately, we can effectively remove duplicate content and improve the quality and efficiency of dictionary files. This is of great significance in both password cracking and other application scenarios based on dictionary files.