Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keyhasher

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyhasher

Simple, effective, easy to implement encryption for JavaScript

  • 1.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by30%
Maintainers
1
Weekly downloads
 
Created
Source

Simple, effective, easy to implement encryption for JavaScript

Logo

Installation

npm install keyhasher

Importing

const { encrypt, decrypt, hash } = require('keyhasher');

Features

  • Encrypts data with multiple processes
  • Uses password numbers to Encrypt and Decrypt

How to use:

  • use 'encrypt()' function with a Passcode number, and convert any sentence to encrypted format.
  • use 'decrypt()' function with the same Passcode number, to get back the Real sentence.
  • use 'hash()' function to finally hash the encrypted value, and later compare
const { encrypt, decrypt, hash } = require('keyhasher');

var hashAble = encrypt("Normal Sentence", process.env.PASSCODE); // encryption
console.log(`Hashed Phrase: ${hashAble}`)

var rawWord = decrypt("Hashed code", process.env.PASSCODE); // decryption
console.log(`Output: ${rawWord}`)

const hashed = hash(hashAble); // encryption + hashing
console.log(`Hashed: ${hashed}`)

Example 💡


var hashAble = encrypt("Hi", 572);
console.log(`Hashed Phrase: ${hashAble}`)

// Hashed Phrase: X4A=

var rawWord = decrypt("X4A=", 572);
console.log(`Output: ${rawWord}`)

// Real Phrase: Hi

const hashed = hash(hashAble);
console.log(`Hashed: ${hashed}`) 

// Hashed: 6ea0e40d8582b04ed49df26051a4359ce015cdddeaad6ddd54dc5540e130e3a7

©IndGeek

©Soumya Mondal

Keywords

FAQs

Package last updated on 11 Apr 2023

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