1.0.1 • Published 6 months ago

nested-shift-cipher v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

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

1.0.1

6 months ago

1.0.0

6 months ago