Socket
Socket
Sign inDemoInstall

cpass

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpass

Simplified secured password two-ways encryption


Version published
Weekly downloads
12K
increased by2.91%
Maintainers
2
Weekly downloads
 
Created
Source

cpass - simplified secured password two-ways encryption

NPM

npm version Downloads Build Status

Encrypts password to some sort of a 'secure string' to be stored in text configs to reduce risks of a silly leak.

Decripts a 'secure string' to plain password.

Installation

npm install cpass --save-dev

or

yarn add cpass --dev

Usage

JavaScript

const Cpass = require('cpass').Cpass;
const cpass = new Cpass();

const password = 'password';

let secured = cpass.encode(password);
// secured: "40bbb043608f54d....MhKghXTcaR2A//yNXg==" - is unique on different machines

let unsecured = cpass.decode(secured);
// unsecured: 'password'

TypeScript

import { Cpass } from 'cpass';
const cpass = new Cpass();

const password = 'password';

let secured = cpass.encode(password);
// secured: "40bbb043608f54d....MhKghXTcaR2A//yNXg==" - is unique on different machines

let unsecured = cpass.decode(secured);
// unsecured: 'password'

Decoding plain text will return it back:

let plainText = 'plain (not encoded text)';
let decodedText = cpass.decode(plainText);
// decodedText: 'plain (not encoded text)'
// plainText === decodedText

Encryption with master key

import { Cpass } from 'cpass';
const cpass = new Cpass('MasterKey');

Tests

Local run

npm run test

Run in Docker for specific Node.js version

# Build an image
docker build -f ./docker/Dockerfile.node8 -t cpass.node8 .
# Run tests
docker run cpass.node8

Comments

This module is not for a real security purposes. Just for 'dummy hackers' secure and minifying risks of any password storage in a plain form.

Once encoded, the password secured form can be decoded only on the same machine, but the logic behind this is very straightforward.

Keywords

FAQs

Package last updated on 24 Mar 2020

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