Skip to content

emilbayes/secure-destroy-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

secure-destroy-key

Build Status

Destroy a Secure Buffer key safely

A piece in the puzzle towards secure-key-management

Usage

var destroyKey = require('secure-destroy-key')
destroyKey(key)

⚠️ Warnings:

  • Once the key is destroyed, any access to it (whether read or write) will crash your program with no mercy

API

destroyKey(secureBuf)

secureBuf must be a Secure Buffer created with sodium-native@2.4 or greater. It can also be a primitive object with some of the following properties (eg. in case of a key pair): private, secret, privateKey, secretKey, public, publicKey, identity or identityKey, which in turn will be called with destroyKey

Destroying the secureBuf will safely wipe the key from memory and mark it for noaccess, to prevent any accidental misuse.

Note that the secureBuf looks like a normal Buffer, but has some extra properties. You can read more about Secure Buffers on secure-key-management Be wary about using any of the default Buffer operations on this Secure Buffer.

Install

npm install secure-destroy-key

License

ISC

About

Destroy a Secure Buffer key safely

Resources

License

Stars

Watchers

Forks

Packages

No packages published