Anchor is a cross-platform desktop application that provides hardware-based authentication using SanDisk USB devices. The application automatically detects USB connection/disconnection events and provides secure database access only when an authorized USB device is connected.
- USB Heartbeat: Real-time detection of SanDisk USB devices (VID: 0x0781)
- Event-Driven Architecture: Instant UI updates on USB connection/disconnection
- Session Wipe: Immediate application lock when USB is removed
- Encrypted Database: SQLite database only accessible when USB is connected
- Windows: WinUSB driver integration via Zadig
- macOS: Native IOKit support (no special setup required)
- Linux: udev rule generation for non-root USB access
- Thread-Safe State: Rust-based backend with Arc<Mutex>
- No Persistent Credentials: Authentication tied to physical USB device
- Immediate Lockout: Session terminates instantly on USB removal
- Device-Only Access: Database encryption tied to USB serial number
- Operating System: Windows 10+, macOS 10.14+, or Linux (Ubuntu 18.04+)
- USB Port: Available USB port for SanDisk device
- Permissions: Administrative access for initial setup (Windows/Linux)
- SanDisk USB Device: Any SanDisk USB storage device (Vendor ID: 0x0781)
- USB Cable: Standard USB connection
- Download the latest release from GitHub Releases
- Install the application
- Run Zadig as Administrator:
- Download Zadig (zadig-2.9.exe)
- Click Options β List All Devices
- Select your SanDisk USB device
- Replace driver with WinUSB
- Launch Anchor
- Download the latest macOS release
- Install the application
- Grant necessary permissions in System Preferences β Security & Privacy
sudo xattr -r -d com.apple.quarantine /path/to/anchor.app
chmod +x /path/to/anchor.app/Contents/MacOS/anchor
- Launch Anchor (no additional setup required)
- Download the latest Linux release
- Extract and install the application
- Linux USB Setup Required
To access USB devices without sudo, create a udev rule: echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0x0781", MODE="0666"' | sudo tee /etc/udev/rules.d/99-anchor-sandisk.rules sudo udevadm control --reload-rules sudo udevadm trigger
- Launch Anchor
- Insert SanDisk USB: The application will automatically detect the device
- Initialize Database: Click "Initialize Database" to create your encrypted storage
- Add Secure Data: Enter and store your sensitive information
- Remove USB: The application locks immediately when USB is disconnected
- Status: Shows "Anchor - Locked" when no USB is detected
- Setup Instructions: Platform-specific setup guidance
- Security Message: Clear indication that database is inaccessible
- Dashboard: Main interface when USB is connected
- Database Management: Initialize and manage encrypted storage
- Data Entry: Add and view secure information
- Session Info: Real-time USB connection status
- Add Data: Type information and press Enter or click "Add"
- View Data: Scroll through stored entries in reverse chronological order
- Auto-Save: Data is automatically encrypted and saved
- USB Detection: nusb crate for cross-platform device enumeration
- Database: rusqlite with device-specific encryption
- Concurrency: tokio async runtime with 1-second polling interval
- State Management: Thread-safe Arc<Mutex> pattern
- Event System: Tauri event listeners for hardware status
- State Management: React hooks for UI state
- Responsive Design: Tailwind CSS for cross-platform consistency
- TypeScript: Full type safety throughout the application
// Conditional compilation for platform-specific code
#[cfg(target_os = "windows")]
fn check_windows_permissions() { /* Windows-specific logic */ }
#[cfg(target_os = "macos")]
fn check_macos_permissions() { /* macOS-specific logic */ }
#[cfg(target_os = "linux")]
fn generate_udev_rule() { /* Linux-specific logic */ }- Physical Security: Requires physical USB device for access
- Session Security: Immediate lockout on USB removal
- Data Protection: Encrypted database with device-specific keys
- No Credentials: No passwords or tokens stored on disk
- USB Detection: Application polls for SanDisk devices every second
- Authentication: USB presence serves as authentication factor
- Database Access: SQLite connection only established when USB verified
- Session Termination: Database connection closed immediately on USB removal
- Driver Problems: Ensure WinUSB driver installed via Zadig
- Device Recognition: Check Device Manager for proper driver
- Permission Issues: Run application as Administrator for first-time setup
- USB Permissions: Verify udev rule installation
- Device Access: Check
/dev/bus/usb/*/*permissions - Detection: Run
lsusb | grep 0781to verify device detection
- Permissions: Check System Preferences β Security & Privacy
- Device Recognition: Verify USB device appears in System Information
- App Permissions: Allow USB device access in security settings
- USB Not Detected: Try different USB port or cable
- Database Errors: Re-initialize database after USB reconnection
- App Crashes: Check console logs for error messages
# Clone the repository
git clone https://github.com/TheEleventhAvatar/Anchor.git
cd Anchor
# Install dependencies
npm install
cd src-tauri && cargo fetch && cd ..
# Development mode
npm run tauri dev
# Build for current platform
npm run tauri buildAnchor/
βββ src/ # React frontend
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ utils/ # Utility functions
β βββ App.tsx # Main application component
βββ src-tauri/ # Rust backend
β βββ src/ # Rust source code
β βββ capabilities/ # Tauri capabilities
β βββ Cargo.toml # Rust dependencies
βββ scripts/ # Setup scripts
β βββ setup_linux.sh # Linux udev setup
βββ public/ # Static assets
- Rust: nusb, rusqlite, tokio, tauri, serde
- Node.js: React, TypeScript, Tailwind CSS
- Build Tools: Tauri CLI, Vite
This project is proprietary software. See the LICENSE file for details.
Contributions are not accepted for this proprietary project. Please report issues through GitHub Issues for security considerations.
For support and security concerns:
- Issues: GitHub Issues
- Documentation: CROSS_PLATFORM_SETUP.md
- Releases: GitHub Releases