1.0.1 • Published 7 years ago

rekrypt v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

Banner Image

Installation

###NPM:

npm i rekrypt --save

Documentation

###Basic Usage

//Import Rekrypt
const rekrypt = require('rekrypt');

//Basic Encryption
//Encrypt takes 3 arguments. 2 of which are optional:
//encrypt('String', 'Key', Timestamp)
var encrypted = rekrypt.encrypt('Hello World!');
//This returns ['Encrypted String', 'key', Timestamp]

//Basic Decryption
//Decrypt takes the same arguments as encrypt
//But the string is the one we want to decrypt.
var decrypted = rekrypt.decrypt(encrypted[0],encrypted[1]);
//Here encrypted[0] is the encrypted string
//And encrypted[1] is the key used to decrypt the message.

console.log(`Encrypted Array: ${encrypted}`);
console.log(`Decrypted String: ${decrypted}`);

###Syntax

encrypt( "String To Encrypt", "Optional Key", Optional Timestamp );
Returns ["Encrypted String", "Encryption Key Used", Timestamp]
decrypt( "String To Decrypt", "Encryption Key", Optional Timestamp );
Returns "Decrypted String"
makekey( length );
Returns "Base64 String"