encryptor-e2e
Version:
`encryptor-e2e` is a lightweight Node.js library that provides **end-to-end encrypted messaging** using a hybrid cryptographic approach — combining **RSA for key exchange** and **AES for message encryption**. It simplifies the process of securely sending
9 lines (8 loc) • 577 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const encryptor_1 = require("./encryptor");
const receiverKeys = (0, encryptor_1.generateKeyPair)();
const senderKeys = (0, encryptor_1.generateKeyPair)();
const { encryptedMessage, encryptedSymmetricKey } = (0, encryptor_1.sendSecureMessage)('👋 from Rahul Karmakar', senderKeys.privateKey, receiverKeys.publicKey);
const originalMessage = (0, encryptor_1.receiveSecureMessage)(encryptedMessage, encryptedSymmetricKey, receiverKeys.privateKey);
console.log('Decrypted Message:', originalMessage);