Coder Social home page Coder Social logo

cryptonode's Introduction

CryptoNode.JS

Crypto.Node

Description

Cryptonode.js is a simple library cryptography for NodeJS

Installation

npm i cryptonode.js

Table of Contents

List Crypto

Caesar Cipher

Description

Name Params Type Data Nullable Description
caesar type string ✖️ d, decode, e, encode
source string ✖️ plaintext
key integer ✔️ key shifter, default value is 13

Sample

const c = new Crypto;

console.log(c.caesar("e", "Defri Indra Mahardika", 3));
console.log(c.caesar("d", "Ghiul Lqgud Pdkduglnd", 3));

// Output : 
// Ghiul Lqgud Pdkduglnd
// Defri Indra Mahardika

Morse

Description

Name Params Type Data Nullable Description
morse type string ✖️ d, decode, e, encode
source string ✖️ plaintext
options object ✔️ you can custom short, long, and space symbol.

Sample

const c = new Crypto;

console.log(c.morse("e", "defri indra mahardika", {
    short: "+"
}));

// Output : 
// -++ + ++-+ +-+ ++ / ++ -+ -++ +-+ +- / -- +- ++++ +- +-+ -++ ++ -+- +-

ROT13

Description

Name Params Type Data Nullable Description
rot13 source string ✖️ plaintext

Sample

const c = new Crypto;

console.log(c.rot13("defri indra mahardika"));

// Output : 
// qrsev vaqen znuneqvxn

NATO

Description

Name Params Type Data Nullable Description
nato type string ✖️ d, decode, e, encode
source string ✖️ plaintext

Sample

const c = new Crypto;

console.log(c.nato("e", "defri indra mahardika"));

// Output : 
// Delta Echo Foxtrot Romeo India(space) India November Delta Romeo Alfa(space) Mike Alfa Hotel Alfa Romeo Delta India Kilo Alfa

Affine Cipher

Description

Name Params Type Data Nullable Description
affine type string ✖️ d, decode, e, encode
source_text string ✖️ plaintext
keys Array ✖️ must contain 2 key number . eg : [3, 1]
custom_letters string ✔️ eg : KLMNOPQRSTUVWXYZABCDEFGHIJ

Sample

const c = new Crypto;
let custom_letters = "OPQRSTUVWXYZABCDEFGHIJKLMN";
let ciphertext = "Iloyx Xmiyz Jzuzyixdz";
let plaintext = "Defri Indra Mahardika"
let key = [3, 1];

console.log(c.affine("e", plaintext, key, custom_letters));
console.log(c.affine("d", ciphertext, key, custom_letters));

// Output : 
// Delta Echo Foxtrot Romeo India(space) India November Delta Romeo Alfa(space) Mike Alfa Hotel Alfa Romeo Delta India Kilo Alfa

Vigenere Cipher

Description

Name Params Type Data Nullable Description
vigenere type string ✖️ d, decode, e, encode
source string ✖️ plain text
keys string ✖️ eg : programme
custom_letters string ✔️ eg : KLMNOPQRSTUVWXYZABCDEFGHIJ

Sample

const CryptoNode = require('cryptonode.js')

const c = new CryptoNode;
let plain_text = "Defri Indra Mahardika";
let cipher_text = "Svtxz Izhgr Agyadhxbo";
let key = "programe";

console.log(c.vigenere('e', plain_text, key));
console.log(c.vigenere('d', cipher_text, key));

// Output : 
// Svtxz Izhgr Agyadhxbo
// Defri Indra Mahardika

Base 64

Description

Name Params Type Data Nullable Description
b64 type string ✖️ d, decode, e, encode
source string ✖️ plain text

Sample

const CryptoNode = require('cryptonode.js');
const c = new CryptoNode;

c.b64("encode", "any carnal pleasu");
c.b64('e', "##Defri indra Mahardika*&^%`");

c.b64("d", "YW55IGNhcm5hbCBwbGVhc3U=");
c.b64('decode', "IyNEZWZyaSBpbmRyYSBNYWhhcmRpa2EqJl4lYA==");

// Output : 
// YW55IGNhcm5hbCBwbGVhc3U=
// IyNEZWZyaSBpbmRyYSBNYWhhcmRpa2EqJl4lYA==
// any carnal pleasu
// ##Defri indra Mahardika*&^%`

cryptonode's People

Contributors

defrindr avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.