https://github.com/oeo/encfile
simple command-line gzip passphrase file encryption
https://github.com/oeo/encfile
Last synced: 2 months ago
JSON representation
simple command-line gzip passphrase file encryption
- Host: GitHub
- URL: https://github.com/oeo/encfile
- Owner: oeo
- Created: 2017-06-02T23:45:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T22:19:47.000Z (over 2 years ago)
- Last Synced: 2025-02-20T00:49:19.886Z (3 months ago)
- Language: CoffeeScript
- Homepage:
- Size: 3.53 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```
.-""-.
/ .--. \
/ / \ \
| | | |
| |.-""-.|
///`.::::.`\
||| ::/ \:: ;
||; ::\__/:: ;
\\\ '::::' /
jgs `=':-..-'`
```# install
using [npm](https://npmjs.org)
```
npm i encfile --save
sudo npm i -g encfile
```# example
``` coffeescript
encfile = require 'encfile'arr = [
file_orig = __dirname + '/../test/image.png'
file_encd = __dirname + '/../test/image.enc'
file_copy = __dirname + '/../test/image-copy.png'
file_fail = __dirname + '/../test/image-fail.png'
]do (=>
x = _.clone(arr)
x.shift()
(if _.exists(f) then rm f for f in x)
)await encfile.encrypt file_orig, file_encd, 'secret', defer e,r
if e then throw eawait encfile.decrypt file_encd, file_copy, 'secret', defer e,r
if e then throw e# should fail
await encfile.decrypt file_encd, file_fail, 'different', defer e,r
if !e then throw new Error 'This should have failed'log "Finished"; exit 0
```# shell
``` shell
Usage:Command: encrypt file (e):
./ e --infile --outfile --key
Command: decrypt file (d):
./ d --infile --outfile --key
`````` shell
encfile e --infile file.zip --outfile file.enc --key secret
encfile d --infile file.zip.enc --outfile file.zip.enc --key secret
```