Skip to content

hemae/hans-cryptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hans-cryptor

string cryptor for node.js

Table of contents

Features

  • encrypting and decrypting strings by password using Vigenere method

Installing

Add the package to your project

npm i hans-cryptor

Example

Export crypt from hans-cryptor

const crypt = require('hans-cryptor')

using TypeScript

import crypt from 'hans-cryptor'

encrypt

const str = 'string for encrypting'
const key = 'this is a key'
const encryptedStr = crypt.encrypt(str, key)
console.log(encryptedStr) // çÜÛÜ�Ð��Ð��ÈëíØÝÜ�Ð

decrypt

const decryptedStr = crypt.decrypt(encryptedStr, key)
console.log(decryptedStr) // string for encrypting

compare

const isMatched = crypt.compare(str, encryptedStr, key)
console.log(isMatched) // true

const anotherKey = 'this is another key'
const anotherEncryptedStr = crypt.encrypt(str, anotherKey)
const isMatchForAnother = crypt.compare(str, anotherEncryptedStr, key)
console.log(isMatchForAnother) // false

About

string cryptor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages