Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.16 KB

README.md

File metadata and controls

40 lines (26 loc) · 1.16 KB

win-protect

Node Addon for CryptProtectData/CryptUnprotectData of Win32 API to encrypt/decrypt data

"Typically, only a user with the same logon credential as the user who encrypted the data can decrypt the data. In addition, the encryption and decryption usually must be done on the same computer" CryptProtectData Win32 documentation

By combining with an additional password this could be a powerful tool to store passwords, api keys or any secret securely

Donate

Installation

npm install win-protect

Examples

Encrypting data

const wp = require("win-protect");

const input = Buffer.from("secret");

const encrypted = wp.encrypt(input);

const decrypted = wp.decrypt(encrypted);

Encrypting data with additional password

const wp = require("win-protect");

const password = Buffer.from("password123");

const input = Buffer.from("secret");

const encrypted = wp.encrypt(input, password);

const decrypted = wp.decrypt(encrypted, password);