Simple, effective, easy to implement encryption for JavaScript
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);
console.log(`Hashed Phrase: ${hashAble}`)
var rawWord = decrypt("Hashed code", process.env.PASSCODE);
console.log(`Output: ${rawWord}`)
const hashed = hash(hashAble);
console.log(`Hashed: ${hashed}`)
Example 💡
var hashAble = encrypt("Hi", 572);
console.log(`Hashed Phrase: ${hashAble}`)
var rawWord = decrypt("X4A=", 572);
console.log(`Output: ${rawWord}`)
const hashed = hash(hashAble);
console.log(`Hashed: ${hashed}`)
©IndGeek
©Soumya Mondal