0.0.6 • Published 8 years ago
7wc v0.0.6
7wc
You should use Bcrypt for your password management and AES-256 for a cipher not this. This was for fun
7wc is an experimental encryption/cipher module.
Private Keys for cipher are generated using Node.js Crypto Library
Example
Hash and Salt
var sevenwc = require('7wc')
// HASH & SALT
sevenwc.hashandsalt("hello {} ! 123 this is a test", 7, function(hashsalt) {
// 7 uptop represent how long you want the salt to be.
// hashsalt would be like something like b08c8d90b71558f10a8441f65ce7e2faaf6663efa8a3faed9255a7400175305f$36bd0ec731d77d
hashsalt = hashsalt
})
// to check if it's valid
sevenwc.hashandsaltcheck("hello {} 123 this is a test", hashsalt, function(result) {
// Result here would be true
// if it wasnt the real password, it would return false.
})
Random Cipher
var sevenwc = require('7wc')
sevenwc.cipher("hi its me", 7, function(cipheredmessage, privkey) {
// 7 uptop represent how long you want the privkey to be.
/* Ciphered message would be something like
CIPHERED MESSAGE: d1b18c4796d826c95d84c83b97e95c8be96778a895c95d84c83b97e97ca786f0220ed371062dcdcdb10c5c8be96778a895859e2b74ecadfea67f931f7ea0a2
and privatekey would be like:
PRIVATE KEY: privkey: eyJoIjoiZjEwOWM4NzJlYzFjNDkiLCJpIjoiMWM3Y2I3NDhkYjgyN2EiLCIgIjoiNDczODEzYjU2YzVhMjgiLCJ0IjoiYzVjZmI2YWMzN2RkNTEiLCJzIjoiOTljOGQ1YjA5YzI3NDIiLCJtIjoiYjU5YWYyY2Y2NzUyM2YiLCJlIjoiMTZmYjczZTQ0ZTI2YjgifQ==
*/
// The Private key output is in Base64
})
License
Copyright (c) 2017 Haskaalo
Licensed under MIT License