A friend of mine lost the password of a zip file of her. She remembers that the password contains digits only (that is, only 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) and is 16 characters long or so. The digits in the password were chosen randomly, by randomly hitting keys. She kept her password in a TXT file, but the file is gone.

Is there any feasible way to recover the password? If so, how can we do that?

I read on the Internet that such long passwords can't be recovered, but I think our case is special because we know that the password is digit-only. We are laywomen in mathematics and can't estimate the amount of time needed to crack the password in our case. Should my friend simply let it go, or is it worth spending time and effort trying to recover the password?


2 Answers 2


the password were chosen randomly, by randomly hitting keys

TL;DR: Feasible to crack if the archive was protected with ZipCrypto, not feasible if the archive was protected with "WinZip" AES encryption.

16 of random digits = 10^16 = 10 000 000 000 000 000 of combinations = 53 bits

It means that, for instance, if you're able to achieve a password verification speed of 100 000 hashes/sec, it will take the following amount of time to brute force the password:

  1. 100000000000 seconds
  2. 1666666667 minutes
  3. 27777778 hours
  4. 1157407 days
  5. 3171 years

More things to consider (thank you, comment section!):

  1. 1000 000 hashes/sec => 317 years of brute force
  2. 10 000 000 hashes/sec => 32 years of brute force (depending on particular WinZip/7-Zip/PKZIP algorithm using GPU (see benchmarks for Nvidia RTX 2080)).
  3. 30 GH/sec => 4 days (I can see some hashcat measurements about PKZIP in the same benchmarks)
  4. 22.7 ZettaHash/sec => a second of brute force. Seems like that is feasible for original PKZIP encryption algorithm which could be brute forced using some specific attack with the speed of "22.7 ZettaHash/sec on a single RTX 2080Ti". You can crack 16 numbers in seconds then. Not AES+PBKDF2 yet which is used in WinZip.

At least two different algorithms are widely used to protect zip archive:

  1. ZipCrypto (PKZIP encryption)
    • Original PKZIP encryption is absolutely weak (it uses CRC32-based key derivation): from 10 MH/sec to 30-100 GH/sec and up to 22.7 ZettaHash/s on 1GPU. You can crack 16 numbers from seconds to 1-2 days feasibility depending on specific attack, hardware and optimization set. If you're not lucky enough than it would be years still.
  2. AES encryption (WnZip encryption)
    • WinZip uses AES-based encryption with PBKDF2-HMAC-SHA1 1000 iterations key derivation: 5 MegaHash/s on 1GPU. And this is 32 years.
  • What verification speed can be achieved on a normal computer?
    – Mitsuko
    Commented May 20, 2020 at 14:01
  • 1
    As I remember on my 8-core computer with GPU enabled I had kind of ~80 000 hashes/sec using hashcat, but maybe somebody has better configuration, that's why I assumed higher rate. But even with 1000 000 hashes per second you end up with 317 years of brute force. Commented May 20, 2020 at 14:04
  • 1
    This answer could be improved by taking the known cryptographic weaknesses in the ZIPCrypto algorithm into account.
    – Philipp
    Commented May 20, 2020 at 14:20
  • 3
    @mti2935, you can reprogram FGPA-based miners, but you can't repurpose ASIC-based miners for different math from the math they were engineered for. It would have to be a ZIP-specific ASIC. Commented May 20, 2020 at 14:40
  • 2
    Worse, the password wasn't 16 characters long, it was "... 16 characters long or so." Could have been less than 16, which isn't too bad, but what if it was 17 characters? 18?
    – Duroth
    Commented May 20, 2020 at 14:42

16 characters is quite long. Even with numbers only it will take a long time. I'm not sure how plausible it will be to try and brute force. Perhaps consider using a file recovery program to try and recover her password txt file instead. If you wish to try brute forcing the zip archive here's a php script for doing so.


#This script will try all numeric passwords which are 16 characters long (excluding those which start with zeros), and reveal the password on completion.
#Install PHP 7, and p7zip (eg: "sudo apt-get install php p7zip-full"). '/dev/null' must exist! Save this script as "script.php" in $PWD. Copy zip archive to $PWD, and name it "file.zip". Execute this script in terminal (eg: "php script.php").
$i = 999999999999999;
while ($i <= 9999999999999999){
    echo "Trying {$i}\n";
    $output = shell_exec("7z t file.zip -p{$i} 2>&1 > /dev/null && echo $?");
    $output = trim($output);
    if ($output === '0'){
        echo "Password is {$i}\n";
        $i = 9999999999999999;

Sample Output (trimmed for size):

user1@vm1:~/Music$ php script.php
Trying 9999999999999995
Trying 9999999999999996
Trying 9999999999999997
Trying 9999999999999998
Trying 9999999999999999
Password is 9999999999999999
  • You can't copyright submissions on this site. Please refer to this site's copyright: "user contributions licensed under cc by-sa. rev 2020.5.21.36879"
    – schroeder
    Commented May 22, 2020 at 7:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .