A comprehensive JavaFX-based secure authentication system written in Java with Maven, featuring password strength checking, secure password hashing, and optional encryption utilities.
- Password Hashing: PBKDF2-based password hashing with random salt generation and 65536 iterations
- Password Strength Checking: Real-time password strength analysis with detailed requirements
- Secure Login: User authentication with secure credential verification
- Encryption Utility: AES-256 symmetric encryption for optional data protection
- Constant-Time Comparison: Protection against timing attacks
- Modern, professional GUI with gradient purple theme
- Real-time password strength meter with color coding
- Password visibility toggle button (π eye icon)
- Registration form with requirements validation
- User-friendly login interface
- Live password requirement feedback
- Emoji indicators for clear feedback (β, β, β )
The interface has been enhanced with modern design elements:
- Gradient Background: Beautiful purple gradient for professional appearance
- Password Visibility: Toggle button to show/hide password while typing
- Color-Coded Strength: Real-time visual feedback with vibrant colors
- Styled Components: Rounded corners, shadows, and modern styling
- Clear Feedback: Success (green β), Error (red β), and Warning (orange β ) indicators
- Better Typography: Segoe UI font with proper hierarchy
- Improved Layout: Better spacing and alignment throughout
- Responsive Design: Proper sizing for all screen sizes
See GUI_IMPROVEMENTS.md for detailed visual improvements and design details.
Secure Authentication System/
βββ pom.xml
βββ README.md
βββ src/
βββ main/java/com/authentication/
β βββ app/
β β βββ SecureAuthApp.java
β βββ security/
β β βββ PasswordHasher.java
β β βββ PasswordStrengthChecker.java
β β βββ EncryptionUtility.java
β β βββ AuthenticationService.java
β βββ ui/
β βββ LoginController.java
βββ test/java/com/authentication/security/
βββ PasswordHasherTest.java
βββ PasswordStrengthCheckerTest.java
βββ EncryptionUtilityTest.java
βββ AuthenticationServiceTest.java
- JavaFX 21.0.1: Modern UI framework for desktop applications
- Java 11+: Core language and runtime
- Maven: Build automation and dependency management
- Bouncy Castle: Cryptographic operations
- SLF4J: Logging framework
- Apache Commons Codec: Base64 encoding/decoding
- Java Development Kit (JDK) 11 or higher
- Maven 3.6.0 or higher
- JavaFX SDK 21.0.1
cd "Secure Authentication System"mvn clean installUsing Maven:
mvn javafx:runUsing Java directly:
mvn package
java -jar target/secure-auth-system-1.0.0-shaded.jar- Launch the application using one of the methods above
- A login/registration window will appear
- Switch to the "Register" tab
- Choose a username
- Enter a password:
- Minimum 8 characters
- Include uppercase letters (A-Z)
- Include lowercase letters (a-z)
- Include numbers (0-9)
- Include special characters (!@#$%^&*)
- The password strength meter provides real-time feedback
- Confirm your password and click "Register"
- Stay on the "Login" tab
- Enter your registered username
- Enter your password
- Click "Login"
- Success message displays upon successful authentication
import com.authentication.security.PasswordHasher;
// Hash a password
String hashedPassword = PasswordHasher.hashPassword("MyPassword123!");
// Verify a password
boolean isValid = PasswordHasher.verifyPassword("MyPassword123!", hashedPassword);import com.authentication.security.PasswordStrengthChecker;
import com.authentication.security.PasswordStrengthChecker.StrengthLevel;
// Check password strength
StrengthLevel strength = PasswordStrengthChecker.checkStrength("Password123!");
// Get requirements message
String requirements = PasswordStrengthChecker.getRequirementsMessage("weak");import com.authentication.security.EncryptionUtility;
// Generate a key
String key = EncryptionUtility.generateKey();
// Encrypt data
String encrypted = EncryptionUtility.encrypt("Sensitive Data", key);
// Decrypt data
String decrypted = EncryptionUtility.decrypt(encrypted, key);import com.authentication.security.AuthenticationService;
AuthenticationService service = new AuthenticationService();
// Register a user
service.registerUser("john_doe", "SecurePassword123!");
// Authenticate a user
boolean authenticated = service.authenticateUser("john_doe", "SecurePassword123!");
// Check current user
String currentUser = service.getCurrentUser();
// Change password
service.changePassword("john_doe", "SecurePassword123!", "NewPassword456!");
// Logout
service.logout();- Password Hashing: Uses PBKDF2 with SHA-256, 65536 iterations, and 32-byte salt
- Timing Attack Prevention: Constant-time comparison for password verification
- Encryption: AES-256 symmetric encryption for data protection
- Random Salt: Each password gets a unique salt
- Logging: Security events are logged for audit purposes
# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=PasswordHasherTest
# Generate test coverage report
mvn test jacoco:report- Very Weak (Score 0): Insufficient length and character diversity
- Weak (Score 1-3): Limited character variety
- Fair (Score 2-5): Decent length and reasonable character mix
- Good (Score 3-7): Strong password with good practices
- Strong (Score 4-9): Very secure password
- Very Strong (Score 5+): Excellent security with all requirements met
The application uses SLF4J for logging. Logs are configured to output to the console by default. Log level can be controlled by:
- Creating a
logback.xmlfile insrc/main/resources/ - Or setting the system property:
-Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG
# Clean build
mvn clean
# Compile source code
mvn compile
# Run tests
mvn test
# Package application
mvn package
# Install locally
mvn install
# View dependency tree
mvn dependency:tree
# Run JavaFX application
mvn javafx:runSolution: Ensure all dependencies are downloaded with:
mvn dependency:resolveSolution: Add JavaFX VM options if running from IDE:
--module-path /path/to/javafx-sdk/lib --add-modules javafx.controls,javafx.fxmlSolution: The application uses local in-memory storage and doesn't bind to network ports.
- Database integration for persistent user storage
- Two-factor authentication (2FA)
- Session management and token-based authentication
- OAuth2/OIDC integration
- Password reset functionality
- User profile management
- Audit logging and activity tracking
- Admin dashboard
- Multi-language support
- HTTPS/TLS support for network operations
This project is provided as-is for educational and development purposes.
For issues, questions, or contributions, please refer to the project documentation or create a ticket in your issue tracker.
Created as a comprehensive secure authentication system demonstration.
Last Updated: January 2026 Version: 1.0.0