wincrypt-th
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

node-dpapi

Node native module to encrypt/decrypt data. On Windows, it uses DPAPI

API:

function protectData(
    userData: Uint8Array,
    optionalEntropy: Uint8Array,
    scope: "CurrentUser" | "LocalMachine"
): Uint8Array;

function unprotectData(
    encryptedData: Uint8Array,
    optionalEntropy: Uint8Array,
    scope: "CurrentUser" | "LocalMachine"
): Uint8Array;

Example:

import * as dpapi from "node-dpapi";

const buffer = Buffer.from("Hello world", "utf-8");

const encrypted = dpapi.protectData(buffer, null, "CurrentUser");
const decrypted = dpapi.unprotectData(encrypted, null, "CurrentUser");

FAQ:

Q: Does this work on all platforms?

A: Currently it just works on Windows

Readme

Keywords

Package Sidebar

Install

npm i wincrypt-th

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

7.8 kB

Total Files

8

Last publish

Collaborators

  • the_celebrimbor