Th3-822 / rapidleech

http://rapidleech.com/forum/
590 stars 522 forks source link

add password protection to ZIP/UNZIP actions #60

Open AliM1988 opened 7 years ago

AliM1988 commented 7 years ago

Hi. I wonder it is possible to add password encryption to ZIP/Unzip actions like Rar/Unrar? It's useful because most of (shared/free) host disable RAR function. By default the zip decryption is enabled. (See code below). I don't know about zip encryption:

<?php
    $zip = new ZipArchive();
    $zip_status = $zip->open("test.zip");

    if ($zip_status === true)
    {
        if ($zip->setPassword("MySecretPassword"))
        {
            if (!$zip->extractTo(__DIR__))
                echo "Extraction failed (wrong password?)";
        }

        $zip->close();
    }
    else
    {
        die("Failed opening archive: ". @$zip->getStatusString() . " (code: ". $zip_status .")");
    }
?>

Thanks.

MythodeaLoL commented 7 years ago

+1 Many RAR and ZIP have password for protection.

Please add this feature, thanks.

Th3-822 commented 7 years ago

At the moment none of the 2 classes used supports encryption

ZipArchive supports it, but it has to be enabled/compiled on the server, so it may not be available on all servers: http://php.net/manual/en/zip.installation.php

Anyways, writting another zip/unzip options for only shown if the module is enabled seems to be a good idea.

AliM1988 commented 7 years ago

AFAIK, in most shared servers zip encryption is disabled because of disabled function "system". But still zip decryption is enabled (code in first comment). Thank you for your attention.