GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ribeaud/node-crypto-config: Small Node config extension which supports encryption

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 

Repository files navigation

NPM Build Status

node-crypto-config

Small Node Config extension which supports encryption.

Installation

  npm install crypto-config

Usage

This library is a wrapper around Config. On instantiation, each string property value matching the pattern ENC(<encrypted-value>) will go through the handler specified in the constructor.

const assert = require('assert');
const crypto = require('crypto');
const algorithm = 'aes-256-ctr';
const Config = require('crypto-config');
// The key which has been used to encrypt the password
const salt = 'secret';

// This is the handler to decrypt your encrypted values
function decrypt(val) {
    assert(text, "Unspecified text");
    const decipher = crypto.createDecipher(algorithm, salt);
    let dec = decipher.update(text, 'hex', 'utf8');
    dec += decipher.final('utf8');
    return dec;
}

// 'crypto-config' instantiation with handler.
const config = new Config(val => {
    return decrypt(val);
}).config;

The Config contains two properties: orig (original configuration values) and config (the handled configuration values).

Thanks

To Jasypt for the inspiration.

License

May be freely distributed under the MIT license. Copyright (c) 2017 Christian Ribeaud

About

Small Node config extension which supports encryption

Topics

cryptonode-confignodejs

Resources

Readme
License
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.