Socket
Book a DemoInstallSign in
Socket

encext

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encext

require.extensions handler for requiring encrypted files (e.g. .js, .json)

0.1.3
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

encext

require.extensions handler for requiring encrypted files (e.g. .js, .json).

Installation

$ npm install encext

Usage

First, we encrypt some files with the included script.

$ encext -r lib/
Password:

Once the encryption password is entered, the above command will recursively encrypt all .js and .json files in the lib/ directory and it's subdirectories. Run encext --help for details on the available options.

Now that we have some encrypted source files, we need to delete the originals prior to deployment. You will need at least one unencrypted source file to bootstrap the process. It will include code something like this

require('encext').init('aes-128-cbc', 'password');

That one line of code will setup the encrypted extension loaders and initialize the cipher with the given algorithm and password. This obviously has to match the one you used when encrypting the files with the encext command line tool.

API

init(algorithm, password)

Initializes the encext module with the given encryption algorithm and derives the encryption key from the given password.

Arguments

  • algorithm - the encryption algorithm to use. It is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are 'aes-128-cbc', 'aes192', etc. On recent releases, openssl list-cipher-algorithms will display the available ciphers.
  • password - the password used to derive the encryption/decryption key

License

(The MIT License)

Copyright (c) 2012 Jeff Kunkle

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

extension

FAQs

Package last updated on 17 Oct 2012

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.