A robust desktop application for secure file hiding and management with user authentication, email-based OTP verification, and encrypted file storage.
- Secure File Hiding: Hide sensitive files with encrypted storage in MySQL database
- User Authentication: Email-based login with OTP verification
- File Management: View, hide, and unhide files with detailed metadata
- Real-time Updates: Dynamic file list updates with progress indicators
- Cross-platform: JavaFX-based GUI for Windows, macOS, and Linux
- Email OTP Verification: Two-factor authentication via email
- Encrypted Storage: Files stored as encrypted binary data in database
- Session Management: Secure user sessions with automatic logout
- Input Validation: Comprehensive email and file validation
- Modern GUI: Clean, responsive JavaFX interface
- Intuitive Navigation: Easy-to-use welcome screen and main dashboard
- File Table View: Sortable table with file details and actions
- Progress Indicators: Visual feedback for file operations
- Status Notifications: Real-time status updates and error handling
- Backend: Java 21 with JavaFX for GUI
- Database: MySQL 8.0+ with JDBC connectivity
- Email Service: JavaMail API with Gmail SMTP
- Build Tool: Apache Maven
- Architecture Pattern: MVC (Model-View-Controller)
FileHider/
βββ src/
β βββ main/
β β βββ java/
β β β βββ org/example/filehider/
β β β β βββ FileHiderApp.java # Main application entry point
β β β βββ model/
β β β β βββ User.java # User entity model
β β β β βββ Data.java # File data model
β β β βββ views/
β β β β βββ fx/
β β β β β βββ WelcomeController.java # Welcome screen controller
β β β β β βββ MainController.java # Main application controller
β β β β βββ Welcome.java # Welcome view
β β β β βββ UserView.java # User view
β β β βββ service/
β β β β βββ SendOTPService.java # Email OTP service
β β β β βββ GenerateOTP.java # OTP generation utility
β β β β βββ UserService.java # User business logic
β β β βββ dao/
β β β β βββ UserDAO.java # User data access
β β β β βββ DataDAO.java # File data access
β β β βββ db/
β β β βββ MyConnection.java # Database connection
β β βββ resources/
β β βββ fxml/
β β β βββ welcome.fxml # Welcome screen layout
β β β βββ main.fxml # Main application layout
β β βββ css/
β β βββ styles.css # Application styling
β βββ test/ # Test files
βββ target/ # Compiled classes
βββ pom.xml # Maven configuration
βββ run-app.bat # Windows launcher script
βββ README.md # This file
- Java: OpenJDK 21 or Oracle JDK 21
- MySQL: MySQL Server 8.0 or higher
- Maven: Apache Maven 3.6 or higher
- Email Account: Gmail account for OTP service
- Install MySQL Server
- Create a new database:
CREATE DATABASE filehider; USE filehider;
- Create required tables:
CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, email VARCHAR(255) UNIQUE NOT NULL ); CREATE TABLE data ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, path VARCHAR(500) NOT NULL, email VARCHAR(255) NOT NULL, bin_data LONGTEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
git clone https://github.com/yourusername/FileHider.git
cd FileHiderEdit src/main/java/db/MyConnection.java:
connection = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/filehider?useSSL=false",
"your_username",
"your_password"
);Edit src/main/java/service/SendOTPService.java:
String from = "your-email@gmail.com";
// Update the password with your Gmail app password
return new PasswordAuthentication(from, "your-app-password");mvn clean compilemvn javafx:runrun-app.batjava --module-path "path/to/javafx-sdk" \
--add-modules javafx.controls,javafx.fxml,javafx.base,javafx.graphics \
-cp "target/classes:path/to/dependencies" \
org.example.filehider.FileHiderApp- Launch Application: Run the application using one of the methods above
- Sign Up: Click "Sign Up" and enter your name and email
- Verify Email: Check your email for OTP and enter it in the application
- Login: Use your email to log in to the application
- Hide Files: Click "Hide New File" to select and hide files
- View Files: All hidden files are displayed in the main table
- Unhide Files: Click "Unhide" button next to any file to restore it
- Refresh: Use "Refresh" button to update the file list
- OTP Verification: Every login requires email OTP verification
- Session Management: Automatic logout for security
- File Encryption: Files are stored encrypted in the database
- Host:
localhost:3306 - Database:
filehider - SSL: Disabled for local development
- SMTP Server:
smtp.gmail.com - Port:
465 - Security: SSL/TLS enabled
- Authentication: Gmail app password required
- Window Size: 800x600 (minimum 600x400)
- File Size Limit: No explicit limit (limited by database)
- Supported File Types: All file types
mvn test- User registration with email verification
- User login with OTP
- File hiding functionality
- File unhiding functionality
- File list refresh
- Error handling for invalid inputs
- Database connection stability
- Email service reliability
Error: Connection refused
Solution: Ensure MySQL server is running and credentials are correct
Error: OTP not sent
Solution: Check Gmail app password and SMTP settings
Error: JavaFX runtime components are missing
Solution: Ensure JavaFX dependencies are properly configured in pom.xml
Error: Access denied when hiding/unhiding files
Solution: Run application with appropriate file system permissions
Enable debug logging by setting system properties:
java -Djavafx.debug=true -Dmail.debug=true org.example.filehider.FileHiderApp- Files are stored as encrypted binary data
- Database connections use prepared statements
- User passwords are not stored (OTP-based authentication)
- Uses Gmail app passwords (not regular passwords)
- SSL/TLS encryption for email transmission
- OTP expiration (implemented in service layer)
- Original files are deleted after hiding
- File paths are validated before processing
- Temporary files are properly cleaned up
- Indexed email fields for faster queries
- Prepared statements for query optimization
- Connection pooling for better resource management
- Streaming file operations for large files
- Proper resource cleanup in DAO layer
- Background task execution for UI responsiveness
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
- Follow Java naming conventions
- Use meaningful variable and method names
- Add comments for complex logic
- Maintain consistent indentation
- Add unit tests for new features
- Test database operations
- Verify email functionality
- Test UI components
This project is licensed under the MIT License - see the LICENSE file for details.
- Soumya Srivastav - GitHub
- JavaFX team for the excellent GUI framework
- MySQL team for the robust database system
- JavaMail API for email functionality
- Maven community for build automation
For support and questions:
- Create an issue on GitHub
Note: This application is designed for educational and personal use. For production deployment, additional security measures and proper infrastructure setup are recommended.