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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yvs dot ppt at hotmail dot fr
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 18 23:01:27 2024 UTC