nested-shift-cipher

1.0.1 • Public • Published

Nested Shift Cipher

Overview

nested-shift-cipher is a flexible, customizable encryption library that provides a unique approach to text transformation using curried encryption methods.

Features

  • Customizable character set
  • Dynamic key generation
  • Cyclic character shifting
  • Flexible encryption and decryption
  • Configurable shift amounts

Installation

npm install nested-shift-cipher

Usage

import NestedShiftCipher from 'nested-shift-cipher';

// Create a new cipher instance
const cipher = new NestedShiftCipher();

// Generate keys (optional)
const { publicKey, privateKey } = cipher.generateKeys();

// Encrypt a message
const message = "Hello, World!";
const encrypted = cipher.encrypt(message);

// Decrypt the message
const decrypted = cipher.decrypt(privateKey);

Advanced Usage

// Custom character set and shift amounts
const customCipher = new NestedShiftCipher({
    replacementChars: 'custom character set'
});

const customEncrypted = customCipher.encrypt(
    message, 
    [5, 2, 9]  // Custom shift amounts
);

License

MIT

Package Sidebar

Install

npm i nested-shift-cipher

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

7.23 kB

Total Files

3

Last publish

Collaborators

  • nathansstm