@augustheart #29
我之前认为主用的是类似 zip4j 之类的库, 然后尝试解压, 抛出异常进行下一次尝试.
目前看来提取关键信息然后尝试那么就需要主手动进行这些二进制数据的解析.
我同时查了一下 John the Ripper, 也是用来暴力破解的, 按照 https://stackoverflow.com/questions/15442565/how-do-you-get-the-password-hash-of-a-zip-file 上面的说法, 它会提取类似你说的关键信息
“`
Output Line Format:
*
* For type = 0 for files encrypted with “rar -hp …” option
* archive_name:$RAR3$*type*hex(salt)*hex(partial-file-contents):type::
::archive_name
*
* For type = 1 for files encrypted with “rar -p …” option
* archive_name:$RAR3$*type*hex(salt)*hex(crc)*PACK_SIZE*UNP_SIZE*0*
archive_name*offset-for-ciphertext*method:type::file_name
*
* or
*
* archive_name:$RAR3$*type*hex(salt)*hex(crc)*PACK_SIZE*UNP_SIZE*1*
hex(full encrypted file)*method:type::file_name
“`
前两种格式的关键信息和你说的类似, 但是它会有一种变体, 也就是最后一个, 需要读取整个文件 `hex(full encrypted file)`.
最后还是很感谢这种有意义的讨论, 学到了不少东西