An open API service indexing awesome lists of open source software.

https://github.com/klappdev/jefl

Java native erase library
https://github.com/klappdev/jefl

cpp cpp20 cpp23 erasing filesystem java jni-java

Last synced: 2 months ago
JSON representation

Java native erase library

Awesome Lists containing this project

README

          

# jefl

This is simple Java library for secure erase files.

When we remove file, remove only name file but content file stay exist.

Sometimes we want that file content can not be recovery again.

For secure erase file used next steps:

> overwrite content file
> truncate file
> random rename file
> delete file

There are the following methods of overwrite content file:

> Simple method - overwrite 1 pass 0x00 bytes
> DOE method - overwrite 3 pass random, random, "DoE"
> RCMP method - overwrite 3 pass 0x00 ,0xFF, "RCMP"
> OPENBSD method - overwrite 3 pass 0xFF, 0x00, 0xFF bytes
> DOD method - overwrite 7 pass
> Gutmann method - overwrite 35 pass

Using this library developer can erase files in the following way.

```Java
native boolean eraseFile(String path) throws EraseException;

native boolean eraseFile(String path, OverwrideMode mode) throws EraseException;

native boolean eraseFiles(String... paths) throws EraseException;

native boolean eraseFiles(OverwrideMode mode, String... paths) throws EraseException;

native boolean eraseDirectory(String path, boolean recur) throws EraseException;

native boolean eraseDirectory(String path, OverwrideMode mode, boolean recur) throws EraseException;
```
Verified:

Static analizer: clang-tidy

Dynamic analizer: valgrind

Requirements:

Java min version: 11

C++ min version: 20