Skip to content
This repository was archived by the owner on Aug 4, 2022. It is now read-only.

Repository files navigation

secure-rm
Secure-rm

Data erasure solution for files and drives

VersionDownloads/weekLicense: MIT

GitHub Workflow Status (branch)GitHub Workflow Status (branch)Code coverage

❓ Why

Secure-rm is composed of two parts: a Node.js module with a straightforward API and a command line interface optimized to delete files on the fly.

When you delete a file using the rm UNIX command or fs.unlink in node, it only removes direct pointers to the data disk sectors and make the data recovery possible with common software tools.

Permanent data erasure goes beyond basic file deletion commands, which:

  1. Allow for selection of a specific standard, based on unique needs,
  2. Verify the overwriting method has been successful and removed data across the entire device.

🔩 How It Works

The basic principle is to write files before deletion in order to make recovery harder. With secure-rm, you get to choose the standard that follow your needs. Each one is composed of instructions about how many passes it should perform.

It goes from a simple pass of zeros to a 35 passes algorithm. Secure-rm comes with its own algorithm to ensure your data is safe:

  • A pass of cryptographically strong pseudo-random data,
  • The file is then renamed,
  • And finally truncated to hide the file size.

✨ Features

📦 Installation

Node and npm required.

$ yarn add secure-rm
# or
$ npm install secure-rm

🚀 Quick Start

If you want your application to delete specific files with a pass of cryptographically strong pseudo-random data, use one of these code snippets:

constsrm=require('secure-rm')srm.remove('./folder/file.js').result.then(()=>console.log('Files successfully deleted !')).catch(console.error)// ORsrm.remove('./folder/file.js',(err)=>{if(err)throwerrconsole.log('Files successfully deleted !')})

📋 Examples

constoptions={standard: srm.standards.gutmann,maxBusyTries: 5}srm.remove('./data/file.js',options).result.then(({count, index})=>console.log(`Successfully deleted ${count} files: ${index}`)).catch(console.error)constevents=srm.remove('./trash/dir/',{standard: srm.standards.schneier},(err,{count, index})=>{if(err)throwerrconsole.log(`Successfully deleted ${count} files: ${index}`))})event.on('removed',(fileName)=>console.log(fileName))

📜 Changelog / History

See the changelog or releases.

🏗️ Contributing

DependenciesContributorsLast commitnpm collaborators

Tested with JestNode versionlanguage

See contributing guidelines

Todo

[] Fix wipeDrive (removed from 5.0)

Licensing

Icon library by Icons8.

This project is under MIT License.

About

Completely erases files by making recovery impossible. (core library for secure-rm)

Topics

Resources

Code of conduct

Contributing

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages