New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

encfile

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encfile

for personal use

  • 0.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
increased by70%
Maintainers
1
Weekly downloads
 
Created
Source
            .-""-.
           / .--. \
          / /    \ \
          | |    | |
          | |.-""-.|
         ///`.::::.`\
        ||| ::/  \:: ;
        ||; ::\__/:: ;
         \\\ '::::' /
     jgs  `=':-..-'`

install

using npm

npm i encfile --save
sudo npm i -g encfile

example

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

Usage: <command> <options>

Command: encrypt file (e):
  ./ e --infile <filename> --outfile <filename> --key <secret>
Command: decrypt file (d):
  ./ d --infile <filename> --outfile <filename> --key <secret>
encfile e --infile file.zip --outfile file.enc --key secret
encfile d --infile file.zip.enc --outfile file.zip.enc --key secret

Keywords

FAQs

Package last updated on 03 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc