Skip to content

tanm-sys/FortressCrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FortressCrypt

Defense-Grade Security System

License Crates.io Version Coverage Status

Table of Contents

Project Overview

Elevator Pitch

FortressCrypt is a next-generation, high-assurance platform designed to safeguard the confidentiality, integrity, and availability of mission-critical data in defense and national security applications. Built with cutting-edge cryptographic protocols, multi-factor authentication (MFA), secure key management, and quantum-resistant algorithms, FortressCrypt ensures robust protection against modern and emerging threats, including quantum computing attacks. It integrates seamlessly with existing Hardware Security Modules (HSMs), Security Information and Event Management (SIEM) tools, and can be customized to meet various operational security levels.

Key Features

  • Multi-Layered Zero-Knowledge Authentication and Authorization
    • Zero-Knowledge Proofs (ZKP)
    • Multi-Factor Authentication (MFA)
    • Dynamic Role-Based Access Control (RBAC)
  • Advanced Quantum-Resistant Cryptography
    • Hybrid Cryptographic Schemes
    • Post-Quantum Key Exchange
  • Secure Key Management with Hardware Security Module (HSM)
    • HSM Integration
    • Automatic Key Rotation
    • Tamper-Proof Key Generation
  • Encrypted and Authenticated Communication
    • AES-256-GCM with GCM Authentication Tags
    • End-to-End Encryption via TLS 1.3
  • Continuous Monitoring and Real-Time Anomaly Detection
    • SIEM Integration
    • Machine Learning-Driven Anomaly Detection
    • Audit Trails
  • Comprehensive Security Audits and Penetration Testing
    • Automated Security Audits
    • Self-Remediation Mechanisms
  • Flexible Security Configuration and Multi-Level Operation Modes
    • Dynamic Security Levels
    • Secure Transmission and Reception
    • Seamless Recovery Protocols

Problem Statement

In today's threat landscape, mission-critical data in defense and national security applications faces threats from advanced cyberattacks, including those leveraging quantum computing. Traditional security systems often fall short in providing sufficient protection against these emerging threats. FortressCrypt addresses this gap by combining cutting-edge cryptographic protocols, secure authentication mechanisms, and robust key management to deliver a defense-grade security solution.

Installation

Prerequisites

  • Rust (Nightly): Install Rust using rustup:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    rustup install nightly
    rustup default nightly
  • HSM: Configure an FIPS 140-2 Level 3 certified HSM for key storage.

  • OAuth 2.0/JWT Provider: Set up an OAuth 2.0 or JWT provider for MFA and access control.

  • TLS 1.3 Server: Ensure the target server supports TLS 1.3 for secure communications.

Installation Steps

  1. Clone the Repository:

    git clone https://github.com/tanm-sys/FortressCrypt.git
    cd FortressCrypt
  2. Configure Dependencies:

    Edit Cargo.toml to ensure all necessary crates are included:

    [dependencies]
    aes-gcm = "0.9.0"
    pqcrypto = { version = "0.7.0", features = ["frodokem"] }
    rand = "0.8.5"
    tokio = { version = "1.0", features = ["full"] }
    hmac = "0.12.1"
    sha2 = "0.10.2"
    rustls = "0.20.1"
    oauth2 = "4.0.0-beta.3"
    serde = { version = "1.0", features = ["derive"] }
    serde_json = "1.0.72"
  3. Build the Project:

    cargo build --release
  4. Run the Application:

    cargo run --release

Quick Start

Example Workflow

Scenario: A defense contractor needs to securely transmit mission-critical data between Alice (a field agent) and Bob (a central command analyst). This workflow ensures the highest security for transmission:

  1. Authentication with MFA: Alice authenticates with MFA using her OAuth 2.0 credentials.

    cargo run -- mfa-auth --user alice --role field-agent
  2. Encrypt Data: Alice encrypts her mission-critical report using AES-256-GCM and quantum-resistant algorithms.

    cargo run -- encrypt --input "mission_report.txt" --output "encrypted_data.txt" --security-level high
  3. Transmit Data: Alice securely transmits the encrypted file over a TLS 1.3 secured channel to Bob at command center.

    cargo run -- transmit --file "encrypted_data.txt" --to "bob@command-center"
  4. Decrypt and Verify: Bob receives the file, decrypts it, and verifies the integrity of the data using quantum-resistant key exchanges.

    cargo run -- decrypt --input "encrypted_data.txt" --output "decrypted_report.txt" --user bob

Usage

Common Use Cases

  • Secure Data Transmission: Defense contractors can use FortressCrypt to securely transmit mission-critical data between field agents and central command analysts.
  • Role-Based Access Control: Organizations can implement dynamic role-based access control to adjust access permissions based on user roles and security levels.
  • Security Audits and Monitoring: Regularly perform comprehensive security audits and penetration testing to identify and address vulnerabilities. Enable real-time monitoring and anomaly detection to promptly identify and respond to potential threats.

Advanced Configuration

  • Dynamic Security Levels: Configure multiple security levels based on operational requirements (e.g., Low, Medium, High).
  • Secure Transmission and Reception: Protect data at rest, in transit, and in use with advanced cryptographic techniques.
  • Seamless Recovery Protocols: Ensure data integrity with integrated backup and disaster recovery plans.

Environment Variables & Flags

The system is highly configurable via environment variables:

Variable Description
HSM_ENDPOINT The endpoint for accessing the Hardware Security Module
TLS_CERT_PATH Path to the TLS certificate file
OAUTH_CLIENT_ID OAuth 2.0 client ID for authentication
OAUTH_CLIENT_SECRET OAuth 2.0 client secret for authentication
SECURITY_AUDIT_INTERVAL Time interval for automated security audits (in hours)
SIEM_ENDPOINT Endpoint for integrating with a SIEM tool

You can also configure the system using a config.json file:

{
  "hsm_endpoint": "https://hsm.example.com",
  "oauth_client_id": "your-client-id",
  "oauth_client_secret": "your-client-secret",
  "tls_cert_path": "/etc/tls/cert.pem",
  "siem_endpoint": "https://siem.example.com"
}

API Reference

Public Classes/Functions

  • UserCredentials: Manages user credentials with secure password hashing.

    • new(username: String, password: String) -> Result<Self, Box<dyn Error>>: Creates a new user credential with secure password hashing.
  • Authentication: Handles user authentication using OAuth 2.0.

    • authenticate_user(credentials: &UserCredentials) -> Result<String, Box<dyn Error>>: Authenticates a user using OAuth 2.0.
    • enforce_mfa() -> Result<(), Box<dyn Error>>: Enforces multi-factor authentication.
  • Encryption: Provides encryption and decryption functionality using AES-256-GCM.

    • encrypt_data(data: &[u8], key: &[u8]) -> Result<(Vec<u8>, Vec<u8>), Box<dyn Error>>: Encrypts data using AES-256-GCM.
    • decrypt_data(ciphertext: &[u8], key: &[u8], nonce: &[u8]) -> Result<Vec<u8>, Box<dyn Error>>: Decrypts data using AES-256-GCM.
  • Quantum: Implements quantum-resistant cryptography using FrodoKEM.

    • apply_quantum_safe_scheme(data: &[u8]) -> Result<Vec<u8>, Box<dyn Error>>: Applies quantum-resistant encryption to data.
  • Transmission: Manages secure data transmission using TLS 1.3.

    • transmit_data(data: &[u8], metadata: &str) -> Result<(), Box<dyn Error>>: Transmits data securely over TLS 1.3.
  • Monitoring: Provides monitoring and anomaly detection capabilities.

    • log_event(metadata: &str): Logs security events to SIEM tools.
    • detect_anomalies(metadata: &str) -> bool: Detects anomalies in system activity.
  • SecurityAudits: Performs security audits and penetration testing.

    • perform_audit(): Performs a scheduled security audit.

Configuration & Customization

Configuration Files

You can configure FortressCrypt using a config.json file. Here's an example:

{
  "hsm_endpoint": "https://hsm.example.com",
  "oauth_client_id": "your-client-id",
  "oauth_client_secret": "your-client-secret",
  "tls_cert_path": "/etc/tls/cert.pem",
  "siem_endpoint": "https://siem.example.com",
  "security_level": "high",
  "audit_interval": 24
}

CLI Flags

FortressCrypt supports various CLI flags for different operations:

  • Authentication:

    • --mfa-auth: Triggers multi-factor authentication.
    • --user: Specifies the username.
    • --role: Specifies the user role.
  • Encryption:

    • --encrypt: Triggers encryption of data.
    • --input: Specifies the input file.
    • --output: Specifies the output file.
    • --security-level: Specifies the security level (low, medium, high).
  • Transmission:

    • --transmit: Triggers data transmission.
    • --file: Specifies the file to transmit.
    • --to: Specifies the recipient.
  • Decryption:

    • --decrypt: Triggers decryption of data.
    • --mfa-token: Specifies the MFA token.
  • Monitoring:

    • --monitor: Triggers monitoring and anomaly detection.
    • --anomaly-detection: Enables anomaly detection.

Architecture & Internals

High-Level Diagram

+-------------------------------------------------------+
|                                                       |
|                    FortressCrypt                      |
|                                                       |
|  +-------------------+  +-------------------------+   |
|  |                   |  |                         |   |
|  |  Authentication   |  |   Encryption/Decryption |   |
|  |                   |  |                         |   |
|  +-------------------+  +-------------------------+   |
|                                                       |
|  +-------------------+  +-------------------------+   |
|  |                   |  |                         |   |
|  |  Key Management   |  |   Secure Transmission   |   |
|  |                   |  |                         |   |
|  +-------------------+  +-------------------------+   |
|                                                       |
|  +-------------------+  +-------------------------+   |
|  |                   |  |                         |   |
|  |  Monitoring       |  |   Security Audits       |   |
|  |                   |  |                         |   |
|  +-------------------+  +-------------------------+   |
|                                                       |
+-------------------------------------------------------+

Module Layout

  • Authentication: Handles user authentication using OAuth 2.0 and multi-factor authentication.
  • Encryption: Provides encryption and decryption functionality using AES-256-GCM.
  • Key Management: Manages cryptographic keys using HSM integration.
  • Transmission: Manages secure data transmission using TLS 1.3.
  • Monitoring: Provides real-time monitoring and anomaly detection.
  • Security Audits: Performs regular security audits and penetration testing.

Contributing

How to Contribute

We welcome contributions from the community. Please follow these steps to contribute:

  1. Fork the repository and create a feature branch (git checkout -b feature-branch).
  2. Commit your changes (git commit -am 'Add new feature').
  3. Push to the branch (git push origin feature-branch).
  4. Submit a pull request.

Pull Request Guidelines

  • Ensure your code follows Rust best practices and adheres to the security-first approach.
  • Write comprehensive unit tests for new features.
  • Document your changes thoroughly.
  • Run cargo fmt to ensure code style consistency.
  • Run cargo clippy to catch potential code issues.

Code of Conduct

By contributing to FortressCrypt, you agree to follow the Code of Conduct.

Roadmap

Upcoming Features

  • Enhanced Quantum-Resistant Algorithms: Integration of additional post-quantum cryptographic algorithms.
  • Improved User Interface: Development of a user-friendly dashboard for monitoring and management.
  • Expanded SIEM Integration: Support for more SIEM tools and enhanced logging capabilities.
  • Containerization: Docker support for simplified deployment.
  • Performance Optimization: Further optimization of cryptographic operations.

Milestones

  • Version 1.0: Initial release with core features (Q3 2023)
  • Version 1.1: Enhanced quantum-resistant algorithms and improved UI (Q4 2023)
  • Version 1.2: Expanded SIEM integration and containerization (Q1 2024)
  • Version 1.3: Performance optimizations and additional security features (Q2 2024)

Frequently Asked Questions (FAQ)

General Questions

  • What is FortressCrypt? FortressCrypt is a defense-grade security system designed to protect mission-critical data in defense and national security applications.

  • What cryptographic algorithms does FortressCrypt use? FortressCrypt uses AES-256-GCM for encryption and FrodoKEM for quantum-resistant cryptography.

  • How does FortressCrypt ensure secure key management? FortressCrypt integrates with Hardware Security Modules (HSMs) to securely store and manage cryptographic keys.

Technical Questions

  • How do I configure FortressCrypt for my organization? You can configure FortressCrypt using environment variables or a config.json file. See the Configuration section for details.

  • What dependencies does FortressCrypt have? FortressCrypt depends on Rust, HSM, OAuth 2.0/JWT provider, and TLS 1.3 server. See the Prerequisites section for details.

  • How do I perform a security audit? You can perform a security audit by running the perform_audit() function. See the Security Audits section for details.

Troubleshooting & Support

Common Errors & Fixes

  • Error: "HSM endpoint not found"

    • Fix: Ensure the HSM_ENDPOINT environment variable is set correctly.
  • Error: "Invalid OAuth credentials"

    • Fix: Verify your OAuth 2.0 client ID and secret are correct.
  • Error: "TLS handshake failed"

    • Fix: Ensure the server supports TLS 1.3 and the certificate path is correct.

Where to File Issues

If you encounter issues or have suggestions, please file an issue on the GitHub Issues page.

Credits & Acknowledgments

We acknowledge the following open-source projects and contributors for their support and inspiration:

License

This project is licensed under the MIT License. Please see the LICENSE file for full details.

Maintainers & Contact


About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages