ChriOnline is a robust Java-based e-commerce platform designed with a strong focus on Network Security and Scalability. It demonstrates a complex multi-client/server architecture using native TCP and UDP sockets, implementing modern security protocols to protect sensitive user data and prevent common network attacks.
- Full E-Commerce Flow: Product browsing, cart management, and secure order processing.
- Advanced Authentication: Secure login system with refresh token mechanism.
- Real-time Notifications: Fast UDP-based push notifications for order updates and alerts.
- Admin Dashboard: Dedicated administrative interface for managing the catalog and monitoring security.
- Modern UI: Responsive JavaFX-based desktop interface.
This project prioritizes defense-in-depth through several security layers:
All critical TCP traffic (Authentication, Payments, Orders) is encrypted using TLSv1.3, ensuring confidentiality and integrity.
- Client/Server Handshake: Uses custom SSLSocketFactory with strictly enforced TLS 1.3.
- Certificate Management: Uses local keystores for secure identity verification.
Prevents attackers from intercepting and re-sending valid requests.
- Nonce & Timestamp: Every request includes a unique UUID (nonce) and a millisecond timestamp.
- Server Validation: The
ReplayProtectionServicemaintains a 30-second window to verify uniqueness and freshness.
Safeguards the notification system against Denial of Service (DoS) attacks.
- Rate Limiting: Limits clients to 3 packets per second.
- Payload Filtering: Maximum payload size restricted to 1 KB to prevent amplification.
- Login Throttling: Limits failed attempts by both IP address and User Email.
- Active Defense: Automatically blocks suspicious actors via the
SecurityManagerfacade.
- Admin Security: Critical administrative endpoints are restricted to specific authorized IPs/Subnets.
- Core: Java 17+
- Network: Native TCP/UDP Sockets (Socket, ServerSocket, DatagramSocket)
- Encryption: TLS 1.3 (JSSE)
- Database: MySQL 8.0+ / JDBC
- Logging: Log4j2 for security auditing
- UI Framework: JavaFX
├── src/main/java
│ ├── client # Logic for socket connection and JavaFX App
│ ├── server # Multi-threaded TCP/UDP server implementation
│ ├── shared # Data Transfer Objects (Requete, Reponse, Session)
│ ├── service # SecurityManager, Replay & UDP protection services
│ ├── dao # Data Access Layer (JDBC / Singleton)
│ ├── model # Domain entities (User, Product, Order)
│ └── ui # JavaFX Controllers & UI Logic
└── src/main/resources
└── fxml # Visual layouts and styles
- Ensure MySQL is running.
- Create a database named
chri_online. - Import the
db_setup.sqlfile provided in the root directory. - Update credentials in
src/main/java/dao/ConnexionBDD.java:private static final String URL = "jdbc:mysql://localhost:3306/chri_online"; private static final String USER = "root"; private static final String PASSWORD = "";
Always start the Server before the client.
- Start Server: Run
src/main/java/server/ServeurTCP.java - Start Client: Run
src/main/java/client/ClientApp.java
The system generates detailed logs for security events. Check the console or log files for:
ALERTE CRITIQUE: Potential Replay Attacks.DÉFENSE ACTIVE: UDP Flood or Brute Force blocks.ACCÈS ADMIN REJETÉ: Unauthorized IP attempts.
Projet de Sécurité Informatique - Application E-Commerce Sécurisée