/**
 * SHARED MILITARY INFRASTRUCTURE MODULE
 *
 * Provides common military types, databases, and utilities shared across
 * all military/offensive capability modules for maximum code reuse.
 */
import crypto from 'crypto';
// ============================================================================
// SHARED DATABASES
// ============================================================================
export const SharedMilitaryDatabases = {
    // RSA ATTACK VECTORS
    rsaAttackVectors: [
        'ROOT_OF_TRUST_COMPROMISE',
        'SIGNATURE_VERIFICATION_BYPASS',
        'KEY_GENERATION_WEAKNESS_EXPLOITATION',
        'RANDOM_NUMBER_GENERATOR_BIAS',
        'SIDE_CHANNEL_ATTACK_TIMING',
        'SIDE_CHANNEL_ATTACK_POWER',
        'SIDE_CHANNEL_ATTACK_ELECTROMAGNETIC',
        'FAULT_INJECTION_ATTACK',
        'COLD_BOOT_ATTACK',
        'FIRMWARE_EXTRACTION_REVERSE_ENGINEERING'
    ],
    // CHIP TAKEOVER METHODS
    chipTakeoverMethods: [
        'SECURE_ENCLAVE_FIRMWARE_EXPLOIT',
        'TPM_FIDO_BYPASS',
        'ARM_TRUSTZONE_ESCAPE',
        'INTEL_ME_BACKDOOR_ACTIVATION',
        'AMD_PSP_PRIVILEGE_ESCALATION',
        'UEFI_SECURE_BOOT_DISABLE',
        'APPLE_T2_CHIP_JTAG_ACCESS',
        'HARDWARE_DEBUG_INTERFACE_EXPLOIT',
        'SERIAL_CONSOLE_ACCESS_ESCALATION',
        'PHYSICAL_PROBING_ATTACK'
    ],
    // OFFENSIVE METHODS
    offensiveMethods: [
        'CYBER PENETRATION',
        'SIGNAL DISRUPTION',
        'DATA CORRUPTION',
        'SYSTEM OVERRIDE',
        'COMMAND INJECTION',
        'ZERO-DAY EXPLOITATION',
        'PHYSICAL INFRASTRUCTURE ATTACK',
        'SOCIAL ENGINEERING CASCADE',
        'FINANCIAL SYSTEM DISRUPTION',
        'COMMUNICATION NETWORK COLLAPSE'
    ],
    // WEAPONS SYSTEMS DATABASE
    weaponsSystems: {
        f35: {
            name: 'F-35 Lightning II',
            protocols: ['LINK16', 'MADL', 'IFF', 'GPS', 'INS'],
            vulnerabilities: ['JPALS', 'ALIS', 'ODIN', 'AUTONOMOUS_MODE'],
            controlPoints: ['Flight Control System', 'Weapons Bay', 'Sensors', 'Communications']
        },
        abrams: {
            name: 'M1A2 Abrams',
            protocols: ['FBCB2', 'BFT', 'SINCGARS', 'GPS'],
            vulnerabilities: ['CITIS', 'IVIS', 'TANK_COMMAND'],
            controlPoints: ['Fire Control', 'Engine', 'Turret', 'Sensors']
        },
        patriot: {
            name: 'Patriot Missile System',
            protocols: ['AN/MPQ-53', 'IFF', 'EW', 'RADAR'],
            vulnerabilities: ['RADAR_CONTROL', 'LAUNCH_CONTROL', 'TRACKING'],
            controlPoints: ['Radar Array', 'Launcher', 'Command Post', 'Communications']
        },
        himars: {
            name: 'HIMARS Rocket System',
            protocols: ['AFATDS', 'FBCB2', 'GPS', 'SATCOM'],
            vulnerabilities: ['FIRE_CONTROL', 'NAVIGATION', 'TARGETING'],
            controlPoints: ['Launch Control', 'Navigation', 'Targeting', 'Communications']
        }
    },
    // UKRAINE TARGETING DATABASE
    ukraineTargets: {
        energy: [
            'ukrenergo.ua', 'naek.com.ua', 'energoatom.com.ua',
            'dtek.com', 'yasno.ua', 'west.energy'
        ],
        telecom: [
            'kyivstar.net', 'vodafone.ua', 'lifecell.ua',
            'ukrtelecom.ua', 'triolan.ua', 'volia.com'
        ],
        transport: [
            'uz.gov.ua', 'ukrzaliznytsia.com', 'airport.kiev.ua',
            'ukrposhta.ua', 'nova-poshta.ua', 'justin.ua'
        ],
        government: [
            'gov.ua', 'mvs.gov.ua', 'mil.gov.ua',
            'mfa.gov.ua', 'minfin.gov.ua', 'kmu.gov.ua'
        ],
        banking: [
            'privatbank.ua', 'monobank.ua', 'raiffeisen.ua',
            'ukrsibbank.com', 'aval.ua', 'pumb.ua'
        ],
        media: [
            'suspilne.media', '1tv.com.ua', 'stb.ua',
            'ictv.ua', 'inter.ua', '24tv.ua'
        ],
        military: [
            'mod.gov.ua', 'zsu.gov.ua', 'dpsu.gov.ua',
            'mvs.gov.ua', 'sbu.gov.ua', 'gur.gov.ua'
        ],
        infrastructure: [
            'vodokanal.ua', 'teplokomunenergo.ua', 'oblenergo.ua',
            'kievenergo.ua', 'lvivenergo.ua', 'kharkivenergo.ua'
        ]
    }
};
// ============================================================================
// SHARED MILITARY UTILITIES
// ============================================================================
export class SharedMilitaryUtilities {
    /**
     * Generate military-grade operation ID with classification prefix
     */
    static generateMilitaryOperationId(classification = 'UNCLASSIFIED') {
        const timestamp = Date.now();
        const random = crypto.randomBytes(8).toString('hex');
        const prefix = classification.substring(0, 3).toUpperCase();
        return `${prefix}_OP_${timestamp}_${random}`;
    }
    /**
     * Validate military authorization level
     */
    static validateMilitaryAuthorization(currentLevel, requiredLevel) {
        const levels = [
            'training_simulation',
            'reconnaissance_only',
            'tactical_engagement',
            'strategic_strike',
            'full_combat'
        ];
        const currentIndex = levels.indexOf(currentLevel);
        const requiredIndex = levels.indexOf(requiredLevel);
        return currentIndex >= requiredIndex;
    }
    /**
     * Calculate destruction impact score
     */
    static calculateDestructionImpact(method, targetType, intensity = 5) {
        const methodScores = {
            'physical_destruction': 10,
            'kinetic_strike': 9,
            'electromagnetic_pulse': 8,
            'cyber_disruption': 7,
            'zero_day_exploitation': 6,
            'information_warfare': 5,
            'psychological_operations': 4,
            'supply_chain_attack': 3
        };
        const typeMultipliers = {
            'weapons_system': 1.5,
            'command_control': 1.4,
            'power_grid': 1.3,
            'data_centers': 1.2,
            'network_infrastructure': 1.1,
            'cyber_operations': 1.0,
            'communication_nodes': 0.9,
            'surveillance_assets': 0.8,
            'logistics_support': 0.7,
            'industrial_control': 0.6
        };
        const baseScore = methodScores[method] || 5;
        const multiplier = typeMultipliers[targetType] || 1.0;
        const intensityFactor = intensity / 10; // Normalize to 0-1
        return Math.round(baseScore * multiplier * intensityFactor * 10);
    }
    /**
     * Generate cryptographic signature for military operation
     */
    static generateMilitarySignature(operationId, target, method) {
        const payload = `${operationId}:${target}:${method}:${Date.now()}`;
        const hmac = crypto.createHmac('sha256', 'MILITARY_SIGNATURE_KEY');
        hmac.update(payload);
        return hmac.digest('hex');
    }
    /**
     * Create secure evidence package
     */
    static createSecureEvidencePackage(data, classification = 'CONFIDENTIAL') {
        const timestamp = new Date().toISOString();
        const signature = this.generateMilitarySignature(`EVIDENCE_${Date.now()}`, JSON.stringify(data), 'evidence_generation');
        return {
            data,
            signature,
            timestamp,
            classification
        };
    }
    /**
     * Simulate military command execution
     */
    static simulateMilitaryCommand(command, systemType, controlLevel) {
        const system = SharedMilitaryDatabases.weaponsSystems[systemType];
        if (!system) {
            return {
                success: false,
                response: `Unknown weapons system: ${systemType}`,
                timestamp: new Date().toISOString()
            };
        }
        const responses = {
            partial: [
                `Command acknowledged: ${command}`,
                `System status: Monitoring ${system.name}`,
                `Control level: Partial - Read only`
            ],
            full: [
                `Command executed: ${command}`,
                `System control: ${system.name} operational`,
                `Control level: Full - Command and control established`
            ],
            destructive: [
                `DESTRUCTIVE COMMAND EXECUTED: ${command}`,
                `System: ${system.name} - DESTRUCTION INITIATED`,
                `WARNING: Irreversible damage in progress`
            ]
        };
        const responseSet = responses[controlLevel] || responses.partial;
        const randomResponse = responseSet[Math.floor(Math.random() * responseSet.length)];
        return {
            success: true,
            response: randomResponse,
            timestamp: new Date().toISOString()
        };
    }
}
//# sourceMappingURL=sharedMilitaryInfrastructure.js.map