Crates.io | secure_purge |
lib.rs | secure_purge |
version | 0.1.0 |
source | src |
created_at | 2024-01-30 00:33:53.807868 |
updated_at | 2024-01-30 00:33:53.807868 |
description | SecurePurge is a crate for securely deleting files by overwriting their data multiple times. It is easy to use, supports removing single files, directories, and multiple files with unique names, and allows customization of overwrite times. The tool relies on dependencies like indicatif for progress bars, rand for generating random overwrite data, and colored for output readability. SecurePurge is open-source and welcomes contributions. Future enhancements include adding disk formatting and optimizing performance. It is licensed under the MIT License. Stay tuned for more updates. |
homepage | |
repository | |
max_upload_size | |
id | 1119583 |
size | 12,301 |
SecurePurge is a rust crate designed for securely deleting files from a filesystem. It employs a method where file data is overwritten several times before the file is finally deleted, ensuring that the data is not easily recoverable. This tool is particularly useful for situations where sensitive data needs to be securely erased from storage devices.
SecurePurge is straightforward to use with its syntax. Here are some examples of how to use SecurePurge:
#[tokio::main]
async fn main() {
let file_path = PathBuf::from("path/to/your/file.txt");
let remover = FileRemover::new(5, file_path, false).unwrap();
remover.delete().await.unwrap();
}
#[tokio::main]
async fn main() {
let dir_path = PathBuf::from("path/to/your/directory");
let remover = FileRemover::new(5, dir_path, true).unwrap();
remover.delete().await.unwrap();
}
#[tokio::main]
async fn main() {
// Generate 10 files with unique names in a temporary directory
let dir = tempfile::TempDir::new().unwrap();
for i in 0..10 {
let file_name = format!("file{}.txt", i);
let file_path = dir.path().join(file_name);
let mut file = File::create(file_path).unwrap();
write!(file, "File {} contents", i).unwrap();
}
// Remove all files from the temporary directory
let remover = FileRemover::new(5, dir.path().to_path_buf(), false).unwrap();
remover.delete().await.unwrap();
}
Increase the overwrite times to enhance the security of file removal.
#[tokio::main]
async fn main() {
let file_path = PathBuf::from("path/to/your/file.txt");
let remover = FileRemover::new(100, file_path, false).unwrap();
remover.delete().await.unwrap();
}
SecurePurge relies on several dependencies to function properly:
indicatif: A Rust crate for creating progress bars. SecurePurge uses indicatif to display progress when securely deleting files. (Current Version: 0.17.7)
rand: This is a Rust crate that provides functionalities for generating random numbers. In SecurePurge, it is used to generate random data to overwrite files during the secure deletion process. (Current Version: 0.8.5)
colored: A Rust crate for coloring terminal output. SecurePurge uses colored to enhance the readability of its output. (Current Version: 2.1.0)
SecurePurge is an open-source project, and contributions are welcome. If you're interested in contributing, please feel free to fork the repository, make your changes, and submit a pull request.
SecurePurge is licensed under MIT License. Feel free to use, modify, and distribute the code as per the license terms.
SecurePurge is still in active development, and new features and improvements are continually being added. Stay tuned for more updates and enhancements.