{"id":20783005,"url":"https://github.com/matschik/monozip","last_synced_at":"2026-02-12T01:20:11.086Z","repository":{"id":184617237,"uuid":"672203397","full_name":"matschik/monozip","owner":"matschik","description":"🔐 Utility library and CLI to encrypt/compress and decompress/decrypt zip folders using AES encryption","archived":false,"fork":false,"pushed_at":"2025-02-17T23:12:39.000Z","size":8667,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T11:42:55.874Z","etag":null,"topics":["aes-encryption","decryption","encryption","zip"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matschik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-29T09:11:02.000Z","updated_at":"2025-02-17T23:12:42.000Z","dependencies_parsed_at":"2025-02-18T00:21:49.469Z","dependency_job_id":"44c1f940-37a5-4584-8b50-99fc96467410","html_url":"https://github.com/matschik/monozip","commit_stats":null,"previous_names":["matschik/monozip"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matschik%2Fmonozip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matschik%2Fmonozip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matschik%2Fmonozip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matschik%2Fmonozip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matschik","download_url":"https://codeload.github.com/matschik/monozip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981180,"owners_count":21193143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-encryption","decryption","encryption","zip"],"created_at":"2024-11-17T14:16:26.507Z","updated_at":"2026-02-12T01:20:06.060Z","avatar_url":"https://github.com/matschik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monozip 📦🔑\n\nUtility library providing encrypt/compress and decompress/decrypt using **AES encryption** 🔐.\n\nWith a simple API, you can easily zip and encrypt a directory and later unzip and decrypt it.\n\n## Features 🚀\n\n- Generate encryption keys 🔑\n- Encrypt and zip folders 📁➡️🔒📦\n- Unzip and decrypt an encrypted zip folder 📦➡️📂🔓\n\n## CLI Usage 💻\n\nMonozip can be used directly from the command line. The general structure of a command is:\n\n```bash\nmonozip [command] [options]\n```\n\n### Installation 💾\n\nTo use the cli, install globally with npm:\n\n```bash\nnpm install -g monozip\n```\n\n### Usage 📖\n\n**To encrypt and zip a folder:**\n\nYou 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.\n\n```bash\nmonozip encrypt ./path/to/folder\n```\n\nAfter 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.\n\n**To unzip and decrypt an encrypted zip file:**\n\nYou 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.\n\n```bash\nmonozip decrypt your-key ./path/to/file.zip\n```\n\nAfter running this command, it will print out the path to the unzipped and decrypted files.\n\n## Programmatic Usage 💡\n\n### Installation 💾\n\nInstall the library using npm:\n\n```bash\nnpm install monozip\n```\n\n### Encryption and Compression 🔐📦\n\nTo encrypt and zip a folder, you can use the `generateKey` and `encryptAndZipFolder` functions. Here is an example:\n\n```javascript\nimport { generateKey, encryptAndZipFolder } from \"monozip\";\n\nconst folderPath = \"downloads/myphotos\";\n\n// Generate a new encryption key\nconst secretKey = generateKey();\n\n// Encrypt and zip the folder\nawait encryptAndZipFolder(secretKey, fixtureFolderPath);\n\nconsole.info(`Encrypted with key ${secretKey} and zipped folder ${folderPath}`);\n// Encrypted with key e96c9074fa... and zipped folder downloads/myphotos.zip. Keep the key safe!\n```\n\n### Decompression and Decryption 📂🔓\n\nTo unzip and decrypt a previously encrypted and zipped file, you can use the `unzipAndDecryptZip` function. Here is an example:\n\n```javascript\nimport { generateKey, unzipAndDecryptZip } from \"monozip\";\n\n// Assume the encryption key is known\nconst secretKey = \"my-secret-key\";\n\n// Unzip and decrypt the zipped file\nconst zipPath = \"downloads/myphotos.zip\";\nconst outputPath = await unzipAndDecryptZip(secretKey, zipPath, {\n  outputPath: \"downloads/myphotos-decrypted\",\n});\n\nconsole.info(`Unzipped and decrypted ${outputPath}`);\n// Unzipped and decrypted downloads/myphotos-decrypted\n```\n\n## Testing 🧪\n\nThe project uses [Vitest](https://github.com/vitest-dev/vitest) for testing.\n\nYou can run the tests with:\n\n```bash\nnpm test\n```\n\n## Contributing 🤝\n\nWe welcome contributions! Please see [here](./CONTRIBUTING.md) for details on how to contribute.\n\n## License 📄\n\nThis project is open source, licensed under the MIT License. See [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatschik%2Fmonozip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatschik%2Fmonozip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatschik%2Fmonozip/lists"}