A lightweight, secure file-sharing web application that allows users to exchange files privately and temporarily through encrypted channels.
Toraje is a React-based web application that enables users to share files securely with a simple, ephemeral approach:
- Upload - Share a file (up to 20MB)
- Share - Get a 6-digit access code
- Download - Recipient uses the code to access the file
- Auto-Expire - Files automatically delete after 69 minutes
All files are protected with AES-256 encryption and are accessible only with the unique access code.
- End-to-End Encryption: Files are encrypted using AES-256 before storage
- No Registration Required: Share files instantly without account creation
- Ephemeral Storage: All files automatically delete after 69 minutes
- Privacy-Focused: No tracking, no logs, no persistent data
- Intuitive Interface: Simple drag-and-drop file uploads
- Mobile Responsive: Works seamlessly across devices
- Lightweight: Fast loading and minimal dependencies
- Frontend: React.js with Vite
- UI Framework: Tailwind CSS
- Icons: Lucide React
- Database: Firebase Realtime Database
- Encryption: CryptoJS (AES-256)
- File Handling: Browser File API, Uint8Array
- Notifications: React Hot Toast
- Node.js 16.x or higher
- npm or yarn
- Firebase account
- Clone the repository:
git clone https://github.com/yourusername/Toraje.git
cd Toraje- Install dependencies:
npm install
# or
yarn install- Create a
.envfile in the project root with your Firebase configuration:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_DATABASE_URL=your_database_url
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_MASTER_KEY=your_master_encryption_key- Start the development server:
npm run dev
# or
yarn dev- Build for production:
npm run build
# or
yarn buildFor proper security, configure your Firebase Realtime Database rules:
{
"rules": {
"files": {
".read": "auth != null || !data.exists()",
".write": "auth != null || !data.exists()",
"$fileId": {
".read": true,
".write": true,
".validate": "newData.hasChildren(['data', 'encryptedKey', 'fileType', 'fileName', 'fileSize', 'expiresAt']) && newData.child('expiresAt').isNumber() && newData.child('expiresAt').val() < (now + 69 * 60 * 1000) && newData.child('expiresAt').val() > now"
}
}
}
}Toraje implements a multi-layered security approach:
- Client-Side Encryption: Files are encrypted in the browser before transmission
- Dual-Key System: Each file gets a unique encryption key, which is itself encrypted
- Temporary Storage: Files exist only for 69 minutes maximum
- One-Time Access: Files are deleted after successful download
- No Server Processing: Files are processed entirely in the client browser
- Generate random 16-byte key:
CryptoJS.lib.WordArray.random(16) - Encrypt file with AES-256:
CryptoJS.AES.encrypt(fileData, randomKey) - Encrypt the random key with master key:
CryptoJS.AES.encrypt(randomKey, MASTER_KEY) - Store encrypted data and encrypted key in Firebase
- Retrieve encrypted data and encrypted key
- Decrypt the random key:
CryptoJS.AES.decrypt(encryptedKey, MASTER_KEY) - Decrypt the file:
CryptoJS.AES.decrypt(encryptedData, decryptedKey) - Convert to downloadable file format
- Visit the application URL
- Drag and drop a file (up to 20MB) onto the upload area
- Wait for encryption and upload to complete
- Copy the 6-digit access code
- Share the code with your recipient along with the application URL
- Visit the application URL
- Enter the 6-digit access code in the download section
- Wait for decryption to complete
- The file will automatically download to your device
- The file is immediately deleted from storage after download
The application is organized into the following main components:
App.jsx: Main application containerFileUpload.jsx: Handles file selection and uploadFileDownload.jsx: Manages code entry and file retrievalHowItWorks.jsx: Detailed explanation of the file sharing processNavbar.jsx: Application navigationFooter.jsx: Application footer with links
- File Size: Maximum file size is 20MB
- Expiration: Files expire after 69 minutes
- Single Use: Each file can be downloaded only once
- Browser Support: Requires modern browsers with File API support
- Multiple file uploads
- Email notifications
- Password protection (optional)
- Extended expiration options
- File preview for common formats
- Progressive Web App support
- Custom branding options
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.