UNPKG

@zheeno/mnemonic-cypher

Version:

This package helps create Mnemonics and uses a generated secret from the phrases for encryption & decryption of data

15 lines (11 loc) 644 B
const {Cypher} = require("@zheeno/mnemonic-cypher"); const cypher = new Cypher() const testObj = {name: "Efezino", age: 28} const mnemonics = cypher.genMnemonics() console.log("Mnemonics =>", mnemonics) // console.log(cypher.secretFromPhrase('swim unusual giraffe gaze share talk left number buzz faint quantum gauge')) // console.log(cypher.phraseFromSecret('7036:4-13342:7-5495:7-3092:4-7885:5-7088:4-4068:4-7266:6-1008:4-3275:5-9814:7-3860:5')) const testEnc = cypher.encrypt(testObj, mnemonics.mnemonics) const testDec = cypher.decrypt(testEnc, mnemonics.mnemonics) console.log("ENC =>", testObj, testEnc) console.log("DEC =>", testDec)