Package Exports
- cryptonode.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cryptonode.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CryptoNode
Description
Cryptonode is a simple library cryptography for NodeJS
Installation
npm i cryptonodeTable 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