SecureChat is a secure messaging application that implements multiple levels of authentication based on risk assessment. The system uses AI-based risk analysis to determine the appropriate security level for each login attempt.
The application implements three security levels:
-
Low Security
- Requires: Username and Password
- Use case: Low-risk scenarios
-
Medium Security
- Requires: Username, Password, and CAPTCHA
- Use case: Medium-risk scenarios or when suspicious activity is detected
-
High Security
- Requires: Username, Password, CAPTCHA, and Face Verification
- Use case: High-risk scenarios, sensitive operations, or when multiple risk factors are detected
The easiest way to run SecureChat is using Docker, which ensures all dependencies are properly installed and configured. This is especially important for the face recognition features.
- Docker installed on your system
- Git to clone the repository
-
Clone the repository and enter the directory:
git clone <repository-url> cd MiniP_Latest -
Run the application using the provided Docker script:
./docker-run.shThis script will:
- Create necessary directories (instance and logs)
- Build the Docker image with all dependencies
- Start the container with proper volume mapping
-
Access the application at:
http://localhost:5000
For a more managed deployment approach, you can use Docker Compose:
-
Run the application using Docker Compose:
docker-compose up -
To run in detached mode (background):
docker-compose up -d -
To stop the application:
docker-compose down
If you prefer to run Docker commands manually:
-
Build the Docker image:
docker build -t securechat . -
Run the Docker container:
docker run -p 5000:5000 \ -v $(pwd)/instance:/app/instance \ -v $(pwd)/logs:/app/logs \ securechat
The application maintains persistent data in two directories:
instance/: Contains the SQLite database fileslogs/: Contains application log files
Both directories are mounted as Docker volumes to ensure data persists between container restarts.
Run the test script to create test users and start the application:
python test_login_security.pyThis will:
- Create test users for each security level
- Start the Flask application
- Provide credentials for testing
-
Start the Flask application:
flask run
-
Navigate to the login page:
http://localhost:5000/auth/login -
Use the Security Level Selector at the bottom of the page to choose a security level:
- "AI-Based" - Will dynamically determine the security level
- "Low" - Will only require username and password
- "Medium" - Will require username, password, and CAPTCHA
- "High" - Will require username, password, CAPTCHA, and face verification
-
Test credentials:
- For Low: Username:
testlow, Password:lowpass123 - For Medium: Username:
testmedium, Password:mediumpass123 - For High: Username:
testhigh, Password:highpass123
- For Low: Username:
To run the automated tests for security levels:
python -m unittest tests/test_login_security.py- The security level is determined either manually or by AI-based risk assessment
- Form validation adapts dynamically based on the security level
- JavaScript handles UI updates to show/hide required authentication factors