php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66925 encrypt feature
Submitted: 2014-03-18 16:15 UTC Modified: 2018-07-13 17:41 UTC
From: yvs dot ppt at hotmail dot fr Assigned: cmb (profile)
Status: Closed Package: Zip Related
PHP Version: * OS: *
Private report: No CVE-ID: None
 [2014-03-18 16:15 UTC] yvs dot ppt at hotmail dot fr
Description:
------------
As "winzip" or "7zip", is-it possible to add encrypt functionnality to ZipArchive ?

may be with:

$zip = new ZipArchive;
$zip->create($zipname, ZipArchive::CREATE);
$zip->setEncryptPassword($secretPhrase); // NEW FEATURE
$zip->addFile($realpath, $localname);
$zip->close();

or:
$zip = new ZipArchive;
$zip->create($zipname, ZipArchive::CREATE, $encryptPassword);



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-18 16:20 UTC] yvs dot ppt at hotmail dot fr
Sorry, there are no method called create for class ZipArchive.

Creation of zip is done with method open :

$zip->open($zipname, ZipArchive::CREATE);
 [2015-07-17 10:43 UTC] cmb@php.net
-Operating System: Windows +Operating System: * -PHP Version: 5.4.26 +PHP Version: *
 [2015-07-17 10:43 UTC] cmb@php.net
Actually, this feature wouldn't require a new method, as
ZipArchive::setPassword() could be used, which currently only
works for reading.
 [2015-09-04 22:59 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2015-09-04 22:59 UTC] cmb@php.net
I'm suspending this request, until the basic feature is
implemented in libzip.
 [2018-07-13 17:41 UTC] cmb@php.net
-Status: Suspended +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-07-13 17:41 UTC] cmb@php.net
Encryption of individual files in Zip archives is available as of
PHP 7.2.0 (requires at least libzip 1.2.0)[1].

[1] <https://github.com/php/php-src/blob/php-7.2.0/UPGRADING#L148-L156>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 16:01:29 2024 UTC