nested-shift-cipher
is a flexible, customizable encryption library that provides a unique approach to text transformation using curried encryption methods.
- Customizable character set
- Dynamic key generation
- Cyclic character shifting
- Flexible encryption and decryption
- Configurable shift amounts
npm install nested-shift-cipher
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);
// 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
);
MIT