The WMTP encryption module provides aes-256-gcm encryption for node.js applications
- clone the repository
- run "npm install" to install dependencies needed to run
The module uses Typescript compiler (TSC) to compile the source code. To build the project run the following command:
- npm run build
You can install the module into your own node.js project as a dependency. For testing purposes you can install using the following command:
- npm install wmt-encryption-module
Once you have the module installed you can import exported functions into your code like so:
import * as encryption from 'wmt-encryption-module'
// import the module
import * as encryption from 'wmt-encryption-module'
// create something
let somePlainText = "some plain text";
// set authentication key or password
encryption.setKey("1234");
// encrypt data
let encryptedText = encryption.encrypt(somePlainText); // encryptedText: "6dd34283b31adfa7fd5ec507d72e33b9"
// decrypt data
let decryptedText = encryption.decrypt(encryptedText); // decryptedText: "some plain text"