New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

substitutioncipher-js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

substitutioncipher-js

This package helps in using substitution cipher inside any package

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

Substitution Cipher

Substitution cipher is the most commonly used cipher and includes an algorithm of substituting every plain text character for every cipher text character. In this process, alphabets are jumbled in comparison with Caesar cipher algorithm.

Installation

you can install this package using npm command

npm i substitutioncipher-js

Usage

substitutioncipher-js contains two function encrypt and decrypt.

  • encrypt function takes the plaintext and key as input or parameter and it returns the ciphertext based on substitution algorithm.
  • decrypt function takes the ciphertext and key as input or parameter and it returns the plaintexttext based on substitution algorithm

Example

//import library
import {encrypt,decrypt} from ('substitutioncipher-js');

//declare plaintext
let plainText = "Hello World";
//declare key
let key=5;
//optional space default true if false give result ignoring space
let space=true

//encrypt function to get ciphertext
var cipherText = encrypt(plainText,key,space);

console.log("encryption",cipherText); //output : Mjqqt btwqi

//decrypt function to get plaintext 
let plaintext = decrypt(cipherText,key);

console.log("Decryption",plaintext); //output : Hello World

LICENSE

This project is under MIT licence. please read License file.

Note: the substitution cipher is easily decryptable

Keywords

FAQs

Package last updated on 05 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc