SDRIVE CLI - Secure File Sharing with End-to-End Encryption
SDRIVE CLI is a powerful command-line tool designed for secure file sharing with end-to-end encryption and per-file key sharing capabilities. Built with security and ease of use in mind, it allows you to share files with others while maintaining complete control over access and ensuring your data remains private and secure.
Features
Installation
- Install using Cargo (Rust's package manager):
First Steps
Quick Start
# Upload a file
# Share a file via P2P
# Download a file P2P
# Download a file IPFS
# Decrypt a file
Commands
Configuration
Create Configuration
This command sets up your SDrive environment with:
- Custom configuration file location
- Dedicated sync directory
- User authentication credentials
- API access key
The configuration is stored securely in your local system and is required for all other operations.
Generate Encryption Key
Creates a secure master encryption key that is stored in your system's keyring. This key is used for:
- Encrypting files before upload
- Decrypting files you download
- Managing access to your shared files
The key is never stored in plain text and is protected by your system's security mechanisms.
Export Key
Exports your master encryption key in base64 format. This is useful for:
- Creating backups of your encryption key
- Transferring your key to another device
- Setting up multiple devices with the same access
⚠️ Security Warning: Store the exported key securely and never share it with unauthorized parties.
Import Key
Imports a previously exported master encryption key from base64 format. This allows you to:
- Restore your key from a backup
- Set up a new device with your existing key
- Maintain consistent access across multiple devices
File Operations
Upload File
Uploads a file to SDrive with multiple layers of security:
- Automatic end-to-end encryption before upload
- Server-side encryption at rest
- Optional per-file sharing key generation
Options:
--unencrypted: Skip encryption for public files--overwrite: Replace existing file--config-path: Use custom configuration file
Share File (P2P)
Share files directly using Iroh's P2P protocol:
- No server dependency
- Direct peer-to-peer transfer
- Unique blob link for sharing
- Supports any file type and size
Download File
Downloads and decrypts files from SDrive with flexible options:
--output: Specify a custom location for the decrypted file--key: Use a per-file sharing key for decryption (optional)
Supports multiple download sources:
- cdn.sdrive.pro: Fast, CDN-based downloads
- ipfs.sdrive.pro: Decentralized IPFS-based downloads
- iroh.blob: Direct P2P downloads
Decrypt File
Decrypts locally stored encrypted files using your keyring:
- Works with any file encrypted by SDrive
- Supports custom output locations
- Maintains security by using your stored master key
Logging
Control the verbosity of logging output with the --log-level flag:
Available log levels:
error: Only show critical errorswarn: Show warnings and errorsinfo: Show general information (default)debug: Show detailed debugging informationtrace: Show extremely detailed debugging information
Troubleshooting
If you encounter any issues, follow these steps:
- Verify your API key is valid and properly configured
- Check your configuration file for correct settings
- Ensure your master key is properly installed in the keyring
- Enable debug logging for detailed error information
- Check your internet connection and firewall settings
- Verify you have sufficient disk space for operations
Security Best Practices
-
Key Management
- Never share your master key
- Use per-file keys for sharing
- Regularly backup your master key
- Use secure storage for key backups
-
File Sharing
- Use encryption for sensitive files
- Share files only with trusted recipients
- Monitor shared file access
- Revoke access when needed
-
Configuration
- Use secure locations for config files
- Regularly rotate API keys
- Monitor sync directory access
- Keep the CLI tool updated
License
This project is licensed under the MIT License, allowing for:
- Commercial use
- Modification
- Distribution
- Private use
See the LICENSE file for full details.
Support
For support, please:
- Check the documentation
- Enable debug logging