Decrypto
Inspired by python decrypto lib
https://github.com/pyGuru123/Decrypto
Install this by command
npm i decrypto
const { AffineCipher } = require('decrypto');
const cipher = new AffineCipher();
const plaintext = 'Hello';
const a = 5;
const b = 7;
const encryptedText = AffineCipher.encrypt(plaintext, a, b);
console.log('Encrypted Text:', encryptedText);
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');
const cipher = new BaconCipher();
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');
const cipher = new Base64Cipher();
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');
const cipher = new BinaryCipher();
const plaintextString = 'Hello, World!';
const plaintextNumber = 12345;
const encryptedTextString = BinaryCipher.encrypt(plaintextString);
console.log('Encrypted Text (String):', encryptedTextString);
const encryptedTextNumber = BinaryCipher.encrypt(plaintextNumber);
console.log('Encrypted Text (Number):', encryptedTextNumber);
const decryptedTextString = BinaryCipher.decrypt(encryptedTextString);
console.log('Decrypted Text (String):', decryptedTextString);
const decryptedTextNumber = BinaryCipher.decrypt(encryptedTextNumber);
console.log('Decrypted Text (Number):', decryptedTextNumber);
const { HexCipher } = require('decrypto');
const cipher = new HexCipher();
const plaintextString = 'Hello, World!';
const plaintextNumber = 12345;
const encryptedTextString = HexCipher.encrypt(plaintextString);
console.log('Encrypted Text (String):', encryptedTextString);
const encryptedTextNumber = HexCipher.encrypt(plaintextNumber);
console.log('Encrypted Text (Number):', encryptedTextNumber);
const decryptedTextString = HexCipher.decrypt(encryptedTextString);
console.log('Decrypted Text (String):', decryptedTextString);
const decryptedTextNumber = HexCipher.decrypt(encryptedTextNumber);
console.log('Decrypted Text (Number):', decryptedTextNumber);
const { OctCipher } = require('decrypto');
const plaintextString = 'Hello, World!';
const plaintextNumber = 12345;
const encryptedTextString = OctCipher.encrypt(plaintextString);
console.log('Encrypted Text (String):', encryptedTextString);
const encryptedTextNumber = OctCipher.encrypt(plaintextNumber);
console.log('Encrypted Text (Number):', encryptedTextNumber);
const decryptedTextString = OctCipher.decrypt(encryptedTextString);
console.log('Decrypted Text (String):', decryptedTextString);
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")
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")
const cipher = new RomanNumCipher();
const encryptedValue = cipher.encrypt(123);
console.log('Encrypted Roman Numeral:', encryptedValue);
const decryptedValue = cipher.decrypt('CXII');
console.log('Decrypted Value:', decryptedValue);