Socket
Socket
Sign inDemoInstall

@techteamer/archiver-zip-encrypted

Package Overview
Dependencies
43
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @techteamer/archiver-zip-encrypted

AES-256 and legacy Zip 2.0 encryption for Zip files


Version published
Maintainers
3
Install size
2.16 MB
Created

Readme

Source

archiver-zip-encrypted

Build Status Coverage Status

Plugin for archiver that adds AES-256 and legacy Zip 2.0 encryption capabilities to Zip compression. Pure JS, no external zip software needed. This fork contains the original 1.0.9 package with updated dependencies to works better with archiver 5+ (tested with archiver@5.3.0).

Install

npm install archiver-zip-encrypted --save

Usage

const archiver = require('archiver');

// register format for archiver
// note: only do it once per Node.js process/application, as duplicate registration will throw an error
archiver.registerFormat('zip-encrypted', require("archiver-zip-encrypted"));

// create archive and specify method of encryption and password
let archive = archiver.create('zip-encrypted', {zlib: {level: 8}, encryptionMethod: 'aes256', password: '123'});
archive.append('File contents', {name: 'file.name'})
// ... add contents to archive as usual using archiver

Encryption methods

Plugin supports 2 encryption methods:

  • 'aes256' - this is implementation of AES-256 encryption introduced by WinZip in 2003. It is the most safe option in regards of encryption, but limits possibilities of opening resulting archives. It's known to be supported by recent versions 7-Zip and WinZip. It is NOT supported by Linux unzip 6.00 (by Info-Zip). It is also NOT supported by Windows explorer (it's possible to browse contents of archive but not possible to view or extract files, i.e. perform operations that require decryption), even in Windows 10.
  • 'zip20' - this is implementation of legacy Zip 2.0 encryption (also called "ZipCrypto" in 7-Zip application). This is the first encryption method added to Zip format and hence is widely supported, in particular by standard tools in Linux and Windows. However its security is proven to be breakable so I would not recommend using it unless you absolutely have to make it work w/o external software.

For more information on these encryption methods and its drawbacks in particular see WinZip documentation. It's worth noting that neither of these encryption methods encrypt file names and their metainformation, such as original size, filesystem dates, permissions etc.

Keywords

FAQs

Last updated on 05 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc