nested-shift-cipher
v1.0.1
Published
A lightweight, curried encryption library with flexible character shifting and key generation
Maintainers
Readme
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-cipherUsage
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
