https://github.com/opencollective/encrypt_dir
Scripts for encrypting and decrypting a dir of folders
https://github.com/opencollective/encrypt_dir
Last synced: 5 months ago
JSON representation
Scripts for encrypting and decrypting a dir of folders
- Host: GitHub
- URL: https://github.com/opencollective/encrypt_dir
- Owner: opencollective
- Created: 2019-07-17T02:09:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-18T09:00:37.000Z (over 1 year ago)
- Last Synced: 2024-10-30T05:43:39.165Z (6 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - opencollective/encrypt_dir - Scripts for encrypting and decrypting a dir of folders (JavaScript)
README
# Encrypt + Decrypt a directory of files
> Uses the [tweetnacl](https://www.npmjs.com/package/tweetnacl) library to encrypt / decrypt files in a directory.
## Setup
clone this repo and run
```sh
npm install
mkdir files_to_encrypt
mkdir files_to_decrypt
```## Generate a key
```sh
$ node generateKey.js
```!!Warning!!
Store this key somewhere sensible. If you lose the key, you can't decrypt your files. Fair warning.
## Encrypt files
Copy the files you want to encrypt into the `files_to_encrypt` folder.
Use your key to encrypt the files.
```sh
KEY=K6RchRUGO0FmWOyqBzCWMjaFPRs0D3undo46wrmrVdM= node encryptDir.js
```Encrypted files are in the folder with an `.encrypted` suffix.
## Decrypt files
Copy the files you want to decrypt into the `files_to_decrypt` folder.
Use your key to decrypt the files.
```sh
KEY=K6RchRUGO0FmWOyqBzCWMjaFPRs0D3undo46wrmrVdM= node decryptDir.js
```Decrypted files are in the folder _without_ an `.encrypted` suffix.