encrypt-folder
Version:
Encrypt a whole folder using AES 256
65 lines (37 loc) • 1.51 kB
Markdown
This project can encrypt whole directories using AES 256 (aes-256-ctr)
The developers of encrypt-folder assume no liability for data loss or any form of damage. Each user is responsible for proper use. It is not possible to decrypt encrypted files without the security key.
**Attention:** You cannot encrypt any binary files like images, executables or disk images. If you encrypt binary files they will break.
Install encrypt-folder with npm
```bash
npm install -g encrypt-folder
```
`encrypt-folder --help` Displays all options
`encrypt-folder encrypt <path> [key]` Encrypts a directory
`encrypt-folder decrypt <path> [key]` Decrypts a direcotry
```javascript
const {util, encrypt, decrypt} = require('encrypt-folder');
// generate a key
const key = util.randomString(32)
// encrypt a string
const encrypted = util.encrypt(text, key)
// decrypt a string
const decrypted = util.decrypt(encrypted, key)
// encrypt a file
util.encryptFile("path/to/file", "path/to/output", key)
// decrypt a file
util.decryptFile("path/to/encrypted/file", "path/to/decrypted/output", key)
// encrypt a directory
encrypt.encryptDirectory("path/to/directory", key)
// decrypt a directory
decrypt.decryptDirectory("path/to/encrypted/directory", key)
```
- [@mctzock](https://www.github.com/mctzock)
For support, join my discord @ https://discord.gg/YEHzrWVTp6