An open API service indexing awesome lists of open source software.

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

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 e

await 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
```