Skip to content

unitiweb/crypter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status js-standard-style

unitiweb-crypter

This is a class that will encrypt, decrypt, and encode strings. Currently it uses cryptr to handle the encryption.

How to use

Install Package

To install the package you would run this code

npm install unitiweb-crypter

Instantiate Class

Library for encrypting, decrypting and encoding strings.

// A random secret key
const secret = 'abc123def456(@%';

// Instantiate the class
const crypter = new Crypter(secret);

Using the Class

Here's how you use the class to encrypt, decrypt, and encode

// Setup the class
const secret = 'abc123def456(@%'
const crypter = new Crypter(secret)

// The string
const myString = 'This is a test'

// Encrypt a string
const myStringEncrypted = crypter.encode(myString)

// Decrypt a string
const myStringDecrypted = crypter.decrypt(myStringEncrypted)

// SHA256 encode a string
const encodedString = crypter.sha256(myString)

About

Library for encrypting, decrypting and encoding strings

Resources

Stars

Watchers

Forks

Packages

No packages published