Giter VIP home page Giter VIP logo

spps-npm's Introduction

spps-npm

Simple Password Protection Solution for Node.js


License Build Status Coverage Status GitHub issues

The SPPS is a lightweight solution to protect / hide your password or anything else from your code.

Features

  • AES 256 GCM en-/decryption
  • Cross programming languages support (Java, Python, Node.js)

Concept

This solution helps one to accidentally publish secrets unintentionally by splitting the secret into an encrypted part and a private key. The private key is kept separately from the rest, in a secure location for the authorized user only.

The private key is randomized for each user on each system and is therefore unique. This means that if someone has the encrypted secret, they can only read it if they also have the private key. You can check this by trying to decrypt the encrypted secret with another user or another system. You will not succeed.

A symmetrical encryption based on the AES-GCM 256 method is used. See also https://en.wikipedia.org/wiki/Galois/Counter_Mode

The private key is stored in a file "/.spps/settings" of the user home folder.

Keep in mind that anyone who has access to the user home or relocation folder also has access to the private key !!!!

Example

const spps = require('spps');

let encryptedSecret = spps.encrypt("My Secret");
console.log("My encrypted secret is " + encryptedSecret);

let secret = spps.decryptString(encryptedSecret)
console.log("...and my secret is " + secret);

How to create a private key

Create a private in your home folder:

Enter following command in your terminal:

node ...

The settings file '~/.spps/settings' in your home folder will look like:

key=5C/Yi6+hbgRwIBhXT9PQGi83EVw2Oe6uttRSl4/kLzc=
relocation=

Alternative, create a private key on a removable device:

Enter following command in your terminal:

node ...

The settings file '~/.spps/settings' in your home folder will look like:

key=
relocation=/Volumes/usb-stick

...and in the relocation folder look like:

key=5C/Yi6+hbgRwIBhXT9PQGi83EVw2Oe6uttRSl4/kLzc=
relocation=

How to create an encrypted password

Enter following command in your terminal:

node ... 

Output should look like:

{MLaFzwpNyKJbJSCg4xY5g70WDAKnOhVe3oaaDAGWtH4KXR4=}

spps-npm's People

Contributors

elomagic avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.