Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 2.63 KB

File metadata and controls

74 lines (52 loc) · 2.63 KB

CaesarPlus For Javascript

CodeFactor GitHub Workflow Status

An advanced caesar cypher javascript module

Click Here to go to python version

What is CaesarPlus

CaesarPlus is a advanced caesar cypher JavaScript module that is more secure than caesar cypher

It makes a unique encryption every time you encode a piece of data.

Setup

npm i CaesarPlus-JS

Frontend/HTML

To use CaesarPlus on a website you can include the script in the body of the html file.

<script src="https://raw.githubusercontent.com/Proactive-Development/CaesarPlus-JS/main/src/web/caesarplus.js" async></script>

Nodejs

Download the repo and place the repo in the node_modules folder.

Or use the quick install script

mkdir node_modules && cd node_modules && wget https://github.com/Proactive-Development/CaesarPlus-JS/archive/refs/heads/main.zip && unzip main.zip && rm main.zip && mv CaesarPlus-JS-main CaesarPlus 

Usage

Frontend/HTML

To encode a piece of data you can use the encode function.

//You must include the script in the body of the html file.
var encrypted = encrypt("Hello World!"); //Encrypt the data
//Now lets output the encrypted data
console.log(JSON.parse(encrypted).text); //This is the text
console.log(JSON.parse(encrypted).key); // This is the decryption key

To decode a piece of data you can use the decode function. The key must be correct to decode the data.

//You must include the script in the body of the html file.
console.log(decrypt(text, key));

NodeJS

To encode a piece of data you can use the encode function.

const caesarplus = require('caesarplus'); //First import the module
var encrypted = caesarplus.encrypt("Hello World!"); //Encrypt the data
//Now lets output the encrypted data
console.log(JSON.parse(encrypted).text); //This is the text
console.log(JSON.parse(encrypted).key); // This is the decryption key

To decode a piece of data you can use the decode function. The key must be correct to decode the data.

const caesarplus = require('caesarplus'); //First import the module

console.log(caesarplus.decrypt(text, key));