Giter VIP home page Giter VIP logo

zbox's Introduction

Zbox Logo Zbox

Travis Crates.io Crates.io GitHub last commit license GitHub stars

Zbox is a zero-details, privacy-focused embeddable file system. Its goal is to help application store files securely, privately and reliably. By encapsulating files and directories into an encrypted repository, it provides a virtual file system and exclusive access to authorised application.

Unlike other system-level file systems, such as ext4, XFS and Btrfs, which provide shared access to multiple processes, Zbox is a file system that runs in the same memory space as the application. It only provides access to one process at a time.

By abstracting IO access, Zbox supports a variety of underlying storage layers. Memory and OS file system are supported now, RDBMS and key-value object store supports are coming soon.

Disclaimer

Zbox is under active development, we are not responsible for any data loss or leak caused by using it. Always back up your files and use at your own risk!

Features

  • Everything is encrypted ๐Ÿ”’, including metadata and directory structure, no knowledge can be leaked to underlying storage
  • State-of-the-art cryptography: AES-256-GCM (hardware), XChaCha20-Poly1305, Argon2 password hashing and etc., empowered by libsodium
  • Content-based data chunk deduplication and file-based deduplication
  • Data compression using LZ4 in fast mode
  • Data integrity is guaranteed by authenticated encryption primitives (AEAD crypto)
  • File contents versioning
  • Copy-on-write (COW ๐Ÿฎ) semantics
  • ACID transactional operations
  • Snapshot ๐Ÿ“ท
  • Support multiple storages, including memory, OS file system, RDBMS (coming soon), Key-value object store (coming soon) and more
  • Built with Rust โ™ฅ๏ธ

Comparison

Many OS-level file systems support encryption, such as EncFS, APFS and ZFS. Some disk encryption tools also provide virtual file system, such as TrueCrypt and VeraCrypt.

This diagram shows the difference between Zbox and them.

Comparison

Below is the feature comparison list.

Zbox OS-level File Systems Disk Encryption Tools
Encrypts file contents โœ”๏ธ partial โœ”๏ธ
Encrypts file metadata โœ”๏ธ partial โœ”๏ธ
Encrypts directory โœ”๏ธ partial โœ”๏ธ
Data integrity โœ”๏ธ partial โœ–๏ธ
Shared access for processes โœ–๏ธ โœ”๏ธ โœ”๏ธ
Deduplication โœ”๏ธ โœ–๏ธ โœ–๏ธ
Compression โœ”๏ธ partial โœ–๏ธ
COW semantics โœ”๏ธ partial โœ–๏ธ
ACID Transaction โœ”๏ธ โœ–๏ธ โœ–๏ธ
Multiple storage layers โœ”๏ธ โœ–๏ธ โœ–๏ธ
API access โœ”๏ธ through VFS through VFS
Symbolic links โœ–๏ธ โœ”๏ธ depends on inner FS
Users and permissions โœ–๏ธ โœ”๏ธ โœ”๏ธ
FUSE support โœ–๏ธ โœ”๏ธ โœ”๏ธ
Linux and macOS support โœ”๏ธ โœ”๏ธ โœ”๏ธ
Windows support โœ–๏ธ partial โœ”๏ธ

How to use

For reference documentation, please visit documentation.

Requirements

Supported Platforms

  • 64-bit Debian-based Linux, such as Ubuntu
  • 64-bit macOS

32-bit OS and Windows are NOT supported yet.

Usage

Add the following dependency to your Cargo.toml:

[dependencies]
zbox = "~0.1"

Example

extern crate zbox;

use std::io::{Read, Write};
use zbox::{init_env, RepoOpener, OpenOptions};

fn main() {
    // initialise zbox environment, called first
    init_env();

    // create and open a repository in current OS directory
    let mut repo = RepoOpener::new()
        .create(true)
        .open("file://./my_repo", "your password")
        .unwrap();

    // create and open a file in repository for writing
    let mut file = OpenOptions::new()
        .create(true)
        .open(&mut repo, "/my_file.txt")
        .unwrap();

    // use std::io::Write trait to write data into it
    file.write_all(b"Hello, world!").unwrap();

    // finish writing to make a permanent version of content
    file.finish().unwrap();

    // read file content using std::io::Read trait
    let mut content = String::new();
    file.read_to_string(&mut content).unwrap();
    assert_eq!(content, "Hello, world!");
}

Build with Docker

Zbox comes with Docker support, it is based on rust:latest and libsodium is included. Check the Dockerfile for the details.

First, we build the Docker image which can be used to compile Zbox, run below commands from Zbox project folder.

docker build --force-rm -t zbox ./

After the Docker image is built, we can use it to build Zbox.

docker run --rm -v $PWD:/zbox zbox cargo build

Or run the test suite.

docker run --rm -v $PWD:/zbox zbox cargo test

Static linking with libsodium

By default, Zbox uses dynamic linking when it is linked with libsodium. If you want to change this behavior and use static linking, you can enable below two environment variables.

export SODIUM_LIB_DIR=/path/to/your/libsodium/lib
export SODIUM_STATIC=true

And then re-build the code.

cargo build

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms of conditions.

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Community

License

Zbox is licensed under the Apache 2.0 License - see the LICENSE file for details.

zbox's People

Contributors

burmecia avatar reiniermaas avatar atallahade avatar youanden avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.