npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

decrypto

v1.2.0

Published

A light-weight encryption & decryption library, Built with power and simplicity!

Downloads

62

Readme

Decrypto

Inspired by python decrypto lib
https://github.com/pyGuru123/Decrypto

Install this by command npm i decrypto

const { AffineCipher } = require('decrypto'); 

// Example usage
const cipher = new AffineCipher();

const plaintext = 'Hello';
const a = 5; // Replace with your 'a' value
const b = 7; // Replace with your 'b' value

// Encrypt
const encryptedText = AffineCipher.encrypt(plaintext, a, b);
console.log('Encrypted Text:', encryptedText);

// Decrypt
const decryptedText = AffineCipher.decrypt(encryptedText, a, b);
console.log('Decrypted Text:', decryptedText);
const { AsciiCipher } = require('decrypto'); 
const cipher = new AsciiCipher();

const plaintext = 'Hello, world!';
const encryptedText = AsciiCipher.encrypt(plaintext);
console.log('Encrypted Text:', encryptedText);

const decryptedText = AsciiCipher.decrypt(encryptedText);
console.log('Decrypted Text:', decryptedText);
const { AtbashCipher } = require('decrypto'); 
const cipher = new AtbashCipher();

const plaintext = 'Hello, World!';
const encryptedText = cipher.encrypt(plaintext);
console.log('Encrypted Text:', encryptedText);

const decryptedText = cipher.decrypt(encryptedText);
console.log('Decrypted Text:', decryptedText);
const { BaconCipher } = require('decrypto'); 
// Instantiate the BaconCipher class
const cipher = new BaconCipher();

// Example usage
const plaintext = 'HELLO';
const encryptedText = cipher.encrypt(plaintext);
console.log('Encrypted Text:', encryptedText);

const decryptedText = cipher.decrypt(encryptedText);
console.log('Decrypted Text:', decryptedText);
const { Base64Cipher } = require('decrypto'); 

// Instantiate the Base64Cipher class
const cipher = new Base64Cipher();

// Example usage
const plaintext = 'Hello, World!';
const encryptedText = Base64Cipher.encrypt(plaintext);
console.log('Encrypted Text:', encryptedText);

const decryptedText = Base64Cipher.decrypt(encryptedText);
console.log('Decrypted Text:', decryptedText);
const { BinaryCipher } = require('decrypto'); 

// Instantiate the BinaryCipher class
const cipher = new BinaryCipher();

// Example usage
const plaintextString = 'Hello, World!';
const plaintextNumber = 12345;

// Encrypt string to binary
const encryptedTextString = BinaryCipher.encrypt(plaintextString);
console.log('Encrypted Text (String):', encryptedTextString);

// Encrypt number to binary
const encryptedTextNumber = BinaryCipher.encrypt(plaintextNumber);
console.log('Encrypted Text (Number):', encryptedTextNumber);

// Decrypt binary to string
const decryptedTextString = BinaryCipher.decrypt(encryptedTextString);
console.log('Decrypted Text (String):', decryptedTextString);

// Decrypt binary to number
const decryptedTextNumber = BinaryCipher.decrypt(encryptedTextNumber);
console.log('Decrypted Text (Number):', decryptedTextNumber);
const { HexCipher } = require('decrypto'); 

// Instantiate the HexCipher class
const cipher = new HexCipher();

// Example usage
const plaintextString = 'Hello, World!';
const plaintextNumber = 12345;

// Encrypt string to hexadecimal
const encryptedTextString = HexCipher.encrypt(plaintextString);
console.log('Encrypted Text (String):', encryptedTextString);

// Encrypt number to hexadecimal
const encryptedTextNumber = HexCipher.encrypt(plaintextNumber);
console.log('Encrypted Text (Number):', encryptedTextNumber);

// Decrypt hexadecimal to string
const decryptedTextString = HexCipher.decrypt(encryptedTextString);
console.log('Decrypted Text (String):', decryptedTextString);

// Decrypt hexadecimal to number
const decryptedTextNumber = HexCipher.decrypt(encryptedTextNumber);
console.log('Decrypted Text (Number):', decryptedTextNumber);
const { OctCipher } = require('decrypto'); 

// Example usage
const plaintextString = 'Hello, World!';
const plaintextNumber = 12345;

// Encrypt string to octal
const encryptedTextString = OctCipher.encrypt(plaintextString);
console.log('Encrypted Text (String):', encryptedTextString);

// Encrypt number to octal
const encryptedTextNumber = OctCipher.encrypt(plaintextNumber);
console.log('Encrypted Text (Number):', encryptedTextNumber);

// Decrypt octal to string
const decryptedTextString = OctCipher.decrypt(encryptedTextString);
console.log('Decrypted Text (String):', decryptedTextString);

// Decrypt octal to number
const decryptedTextNumber = OctCipher.decrypt(encryptedTextNumber);
console.log('Decrypted Text (Number):', decryptedTextNumber);
const { ReverseCipher } = require('decrypto'); 

const plaintext = 'Hello, World!';
console.log('Original Text:', plaintext);

const encryptedText = ReverseCipher.encrypt(plaintext);
console.log('Encrypted Text:', encryptedText);

const decryptedText = ReverseCipher.decrypt(encryptedText);
console.log('Decrypted Text:', decryptedText);
let { ROT13Cipher } = require("decrypto")
// Usage in JavaScript
const cipher = new ROT13Cipher();

const plaintext = 'Hello, World!';
console.log('Original Text:', plaintext);

const encryptedText = cipher.encrypt(plaintext);
console.log('Encrypted Text:', encryptedText);

const decryptedText = cipher.decrypt(encryptedText);
console.log('Decrypted Text:', decryptedText);
let { RomanNumCipher } = require("decrypto")
// Usage in JavaScript
const cipher = new RomanNumCipher();

const encryptedValue = cipher.encrypt(123); // Encrypting a number
console.log('Encrypted Roman Numeral:', encryptedValue);

const decryptedValue = cipher.decrypt('CXII'); // Decrypting a Roman numeral
console.log('Decrypted Value:', decryptedValue);