multi-layers-encryption
Version:
Encryption and decryption with multiple configurable layers
19 lines (14 loc) • 529 B
text/typescript
import { MultiLayerEncryption } from "./index";
describe("MultiLayerEncryption", () => {
const layers = [
{ algorithm: "aes-256-cbc", key: "secret123", salt: "salt1" },
{ algorithm: "aes-192-cbc", key: "secret456", salt: "salt2" }
];
const enc = new MultiLayerEncryption(layers);
test("encrypt and decrypt should work", () => {
const text = "Hello Multi Layer Encryption!";
const encrypted = enc.encrypt(text);
const decrypted = enc.decrypt(encrypted);
expect(decrypted).toBe(text);
});
});