Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

78 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

BwtFS: Privacy-Preserving File System

๐ŸŒ Chinese | Development doc | Config

๐Ÿš€ Next-Generation Privacy-Preserving File System - Featuring Black-White Tree Structure and RCA Encryption for Anti-Tracking Storage and Non-Recoverable Access

โœจ Core Features

๐Ÿ”’ Privacy Protection

  • Anti-Tracking Storage: Black-White Tree layered structure with random data distribution that prevents access pattern tracing
  • Non-Recoverable Access: Token mechanism + multi-layer encryption ensures deleted data is completely unrecoverable
  • Secure Memory: Memory data remains encrypted at all times, preventing memory dump

โšก High-Performance Architecture

  • Hybrid Storage: intelligent optimal strategy selection of memory and bwtfs
  • COW Mechanism: Copy-on-Write protects data integrity while supporting concurrent access

๐ŸŒ Multiple Access Methods

  • FUSE Mount: Cross-platform filesystem mounting (Windows/macOS/Linux)
  • Command Line Tools: Interactive and batch operation modes
  • HTTP Service: RESTful API + Modern Web management interface

๐Ÿ—๏ธ Technical Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  User Interface Layer               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ FUSE Mount  โ”‚  โ”‚ CMD Tools   โ”‚  โ”‚ HTTP Serviceโ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                  Core Engine Layer                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ B&W Tree    โ”‚  โ”‚ RCA Crypto  โ”‚  โ”‚ Token Accessโ”‚  โ”‚
โ”‚  โ”‚ Storage     โ”‚  โ”‚             โ”‚  โ”‚ Control     โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                 Storage Layer                       โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Bitmap      โ”‚  โ”‚ Wear Level  โ”‚  โ”‚ Transaction โ”‚  โ”‚
โ”‚  โ”‚ Management  โ”‚  โ”‚ Balancing   โ”‚  โ”‚ Mechanism   โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                  Physical Layer                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                   โ”‚
โ”‚  โ”‚ Memory Pool โ”‚  โ”‚ File System โ”‚                   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

System Requirements

Development Environment:

  • C++20 or higher
  • CMake 3.10+
  • Git

Runtime Dependencies:

  • Windows: WinFSP runtime
  • macOS: macFUSE 2.9+
  • Linux: libfuse3

Web Interface (Optional):

  • Node.js 16.0+ (for development)
  • pnpm 8.0+ (package manager)
  • Modern browser (Chrome 90+, Firefox 88+, Safari 14+)

Build & Install

# Clone the project
git clone https://github.com/zaoweiceng/BwtFS.git
cd BwtFS

# Create build directory
mkdir build && cd build

# Configure project
cmake ..

# Build (Linux/macOS)
make

# Build (Windows)
cmake --build .

After compilation, executables are located in build/bin/ directory:

  • bwtfs_cmd - Command line tools
  • bwtfs_mount - FUSE mount tool
  • bwtfs_net - HTTP service

Web Interface Setup

# Navigate to web directory
cd net/web

# Install dependencies with pnpm
pnpm install

# Start development server
pnpm start

# Production build
pnpm build

# Access web interface
# http://localhost:3000

๐Ÿš€ Complete startup process:

  1. Start the backend service: ./build/bwtfs_net (port 9999)
  2. Start the front-end interface: cd net/web && pnpm start (port 3000)
  3. visit: http://localhost:3000

Basic Usage

1. Command Line Tools

# Create filesystem (256MB)
./bwtfs_cmd create ./myfs.bwt 256

# Write file
./bwtfs_cmd write ./myfs.bwt ./document.pdf
# Output: โœ“ File written successfully, Token: abc123def456...

# Read file
./bwtfs_cmd retrieve ./myfs.bwt abc123def456... ./output.pdf

# Delete file
./bwtfs_cmd delete ./myfs.bwt abc123def456...

# View system information
./bwtfs_cmd info ./myfs.bwt

2. FUSE Mount

# Mount to X: drive (Windows)
./bwtfs_mount.exe X: ./myfs.bwt ./fs.json

# Mount to mount point (Linux/macOS)
./bwtfs_mount ./mountpoint ./myfs.bwt ./fs.json

# Now use it like a regular filesystem
echo "Hello BwtFS" > X:\test.txt
copy X:\test.txt .\

# Unmount (Linux/macOS)
umount ./mountpoint
# Windows just exit the program

3. HTTP Service & Web Interface

# Start HTTP server (from build directory)
./bwtfs_net

# Access Modern Web interface
Open browser: http://localhost:3000

# Access API directly
API Base URL: http://127.0.0.1:9999

# API download file
curl -O http://127.0.0.1:9999/abc123def456...

Web Interface Features:

  • ๐ŸŽจ Modern-style UI - Modern, responsive design
  • ๐Ÿ“ File Management - Drag-drop upload, folder operations, search
  • ๐Ÿ” File Preview - Built-in preview for images, PDF, text, markdown
  • ๐Ÿ” Privacy-focused - Token-based access with secure operations
  • โšก Real-time Updates - Toast notifications and live status
  • ๐Ÿ“ฑ Mobile Ready - Responsive design for all devices

๐Ÿ“– Documentation

Document Description
README_DEV.md Complete development documentation with architecture design and API documentation
README_CONFIG.md Detailed configuration file documentation
net/README.md BwtFS ็ฝ‘็ปœๆœๅŠกๅฎŒๆ•ดๆ–‡ๆกฃ - ๅŒ…ๅซๅŽ็ซฏ API ๅ’Œๅ‰็ซฏ้›†ๆˆ
net/web/README.md Web ๅ‰็ซฏ็•Œ้ข่ฏฆ็ป†ๆ–‡ๆกฃ - React ๆŠ€ๆœฏๆ ˆๅ’ŒๅŠŸ่ƒฝ่ฏดๆ˜Ž
fs/README.md FUSE subproject documentation
fs/README_DEV.md FUSE development documentation
net/README_DEV.md HTTP service development documentation

๐Ÿ”ง Configuration

BwtFS uses bwtfs.ini configuration file:

[logging]
log_level = INFO
log_path = ./bwtfs.log
log_to_file = false
log_to_console = true

[system]
# BwtFS system file path (optional, default ./bwtfs.bwt)
# path = ./bwtfs.bwt

[server]
# HTTP service configuration
host = 127.0.0.1
port = 9999
max_body_size = 104857600

๐ŸŽฏ Use Cases

Personal Users

  • Private File Backup: Secure backup of personal sensitive data
  • Temporary File Processing: Secure handling of temporary sensitive data
  • Cross-device Transfer: Encrypted file secure transfer between different devices

๐Ÿ”ฌ Technical Highlights

RCA Encryption Algorithm

Random Cellular Automata based encryption algorithm:

  • Forward Encryption: Multi-level encryption during data writing
  • Backward Decryption: Step-by-step decryption during data reading
  • Random Seeds: Each node uses independent random seeds

Black-White Tree Structure

Innovative layered storage structure:

  • White Nodes: Store actual file data
  • Black Nodes: Store index information of white nodes
  • Random Distribution: Nodes are randomly distributed in storage space

Token Access Control

  • Unique Identifier: Each file generates a unique access token
  • Information Encapsulation: Token contains position, size, encryption parameters and other information
  • Access Control: Files cannot be accessed without correct token

Hybrid Storage Strategy

  • Temp Files: Stored in memory for fast access
  • User Files: Stored in BwtFS with encryption protection
  • Intelligent Selection: Automatically selects optimal storage strategy based on file characteristics

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

Thanks to the following open source projects:

Core System:

Web Frontend:


โญ If this project helps you, please give us a star!

About

This project aims to research and implement an efficient file system focused on protecting the privacy of users' private files. In multi-user or highly confidential environments, this system ensures the secure use of files.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages