Skip to content

Repository files navigation

node-dpapi

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

API:

functionprotectData(userData: Uint8Array,optionalEntropy: Uint8Array,scope: "CurrentUser"|"LocalMachine"): Uint8Array;functionunprotectData(encryptedData: Uint8Array,optionalEntropy: Uint8Array,scope: "CurrentUser"|"LocalMachine"): Uint8Array;

Example:

import*asdpapifrom"node-dpapi";constbuffer=Buffer.from("Hello world","utf-8");constencrypted=dpapi.protectData(buffer,null,"CurrentUser");constdecrypted=dpapi.unprotectData(encrypted,null,"CurrentUser");

FAQ:

Q: Does this work on all platforms?

A: Currently it just works on Windows

About

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

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages