secure_backup

Crates.iosecure_backup
lib.rssecure_backup
version0.1.0
sourcesrc
created_at2023-11-06 18:50:01.960591
updated_at2023-11-06 18:50:01.960591
descriptionTake an incremental secure backup from a directory
homepagehttps://github.com/bitair-org/secure-backup
repositoryhttps://github.com/bitair-org/secure-backup
max_upload_size
id1027114
size1,142,152
Behzad Eshan (beshan)

documentation

README

Intro

This crate takes an incremental backup from a directory while encrypting its entire content, including filenames. It supports AES256 and Chacha20 ciphers and uses the OpenSSL library via openssl crate.

Usage

The OpenSSL library must be already installed on the host OS:

# On Debian
$ sudo apt install libssl-dev
  use std::{env, path::Path};

  use secure_backup::{
    backup::take_backup,
    restore::restore_backup,
    common::Cipher
  };

  let current_dir = env::current_dir().unwrap();
  let password = "password";
  let salt = "salt";
  let ignore_list = vec!["*.ignore"];

  let source_dir = current_dir.join(Path::new("path_to_the_src_dir")).to_path_buf();
  let backup_dir = env::temp_dir().join("path_to_the_backup_dir").to_path_buf();

  // Take a backup
  take_backup(&source_dir, &backup_dir, Cipher::AES256, password, salt, &ignore_list);  

  // Restore the backup
  let restore_dir = env::temp_dir().join("path_to_the_restore_dir").to_path_buf();
  restore_backup(Cipher::AES256, &backup_dir, &restore_dir, password, salt);  

License

MIT License

Commit count: 1

cargo fmt