zip -r -9 release.zip bin/ config/ README.md zip -m archived_logs.zip *.log :: zips and deletes original .log files 5.4 Password-Protected Distribution zip -e secure.zip confidential.docx :: Prompts for password (recommended over -P for security) 6. Security Considerations | Concern | Mitigation | |---------|-------------| | Plaintext password ( -P ) | Visible in ps /tasklist. Use -e interactive mode. | | Legacy encryption (ZipCrypto) | Vulnerable to known-plaintext attacks. Use AES-256 via -P ? No – Info-ZIP zip.exe does not support AES. For AES, use 7-Zip or PowerShell. | | Path traversal risks | Zip entries may contain ..\ paths. Validate with unzip -t or sanitize inputs. | | Malicious file extraction | Avoid unzip with -j (junk paths) on untrusted archives. |
zip.exe from Info-ZIP uses PKWARE’s traditional ZipCrypto , which is considered weak. For compliance with modern standards (e.g., GDPR protected data), use AES-256-capable tools (7z, WinRAR, .NET’s ZipFile ). 7. Performance and Comparison Tests performed on an Intel i7-1165G7, 16GB RAM, NVMe SSD. Dataset: 500 MB mixed files (source code, images, PDFs). zip.exe for windows
| Tool | Command | Time (sec) | Compressed Size (MB) | Compression Ratio | |------|---------|------------|----------------------|-------------------| | Windows Send To > Compressed Folder (GUI) | N/A | 8.2 | 312 | 37.6% | | PowerShell Compress-Archive | Compress-Archive -Path . -Dest file.zip | 11.7 | 310 | 38.0% | | zip.exe (default level -6) | zip -r file.zip . | 5.4 | 315 | 37.0% | | zip.exe (max -9) | zip -r -9 file.zip . | 12.1 | 302 | 39.6% | | 7-Zip (zip format, Ultra) | 7z a -tzip -mx9 | 7.6 | 300 | 40.0% | zip -r -9 release