Skip to content

niradler/strcrypter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strcrypter

Encrypt and decrypt strings easily, no dependencies, using crypto.

Installing

npm i strcrypter

USAGE

//random iv
const Crypter = require("strcrypter");
const key = Crypter.createKey();
const secret = "my secret";
let crypter = new Crypter({ key });
const encrypted = crypter.encrypt(secret);
console.log(encrypted);
crypter = new Crypter({ key, iv: encrypted.iv });
const decoded = crypter.decrypt(encrypted.data);
console.log(decoded);
//set iv
const Crypter = require("strcrypter");
const key = Crypter.createKey();
const iv = Crypter.createKey();
const secret = "my secret";
const crypter = new Crypter({ key, iv });
const encrypted = crypter.encrypt(secret);
console.log(encrypted);
const decoded = crypter.decrypt(encrypted.data);
console.log(decoded);

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Encrypt and decrypt strings easily, no dependencies, using crypto.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published