
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
Utility library that provides functionality to compress, encrypt, and decompress files using AES encryption
Monozip is a utility library that provides functionality to compress, encrypt, and decompress files using AES encryption 🔐.
With a simple API, you can easily zip and encrypt a directory and later unzip and decrypt it.
Monozip can be used directly from the command line. The general structure of a command is:
monozip [command] [options]
To use the cli, install globally with npm:
npm install -g monozip
To encrypt and zip a folder:
You can specify an encryption key and an output path using the -k and --output options respectively. If not specified, a key will be generated automatically, and the output file will be saved in the current directory.
monozip encrypt ./path/to/folder
After running this command, it will print out the encryption key used (keep it safe, you will need it to decrypt 🔐), and the path to the zipped file.
To unzip and decrypt a file:
You need to provide the encryption key and the path to the zipped file. You can also specify an output path using the -o option. If not specified, the file will be unzipped in the current directory.
monozip decrypt your-key ./path/to/file.zip
After running this command, it will print out the path to the unzipped and decrypted files.
Install the library using npm:
npm install monozip
To encrypt and zip a folder, you can use the generateKey and encryptAndZipFolder functions. Here is an example:
import { generateKey, encryptAndZipFolder } from "monozip";
const folderPath = "downloads/myphotos";
// Generate a new encryption key
const secretKey = generateKey();
// Encrypt and zip the folder
await encryptAndZipFolder(secretKey, fixtureFolderPath);
console.info(`Encrypted with key ${secretKey} and zipped folder ${folderPath}`);
// Encrypted with key e96c9074fa... and zipped folder downloads/myphotos.zip. Keep the key safe!
To unzip and decrypt a previously encrypted and zipped file, you can use the unzipAndDecryptZip function. Here is an example:
import { generateKey, unzipAndDecryptZip } from "monozip";
// Assume the encryption key is known
const secretKey = "my-secret-key";
// Unzip and decrypt the zipped file
const zipPath = "downloads/myphotos.zip";
const outputPath = await unzipAndDecryptZip(secretKey, zipPath, {
outputPath: "downloads/myphotos-decrypted",
});
console.info(`Unzipped and decrypted ${outputPath}`);
// Unzipped and decrypted downloads/myphotos-decrypted
The project uses Vitest for testing.
You can run the tests with:
npm test
We welcome contributions! Please see here for details on how to contribute.
This project is open source, licensed under the MIT License. See LICENSE for details.
FAQs
Utility library that provides functionality to compress, encrypt, and decompress files using AES encryption
We found that monozip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.