Commit Graph

123 Commits

Author SHA1 Message Date
lockbitchat
39ae9f01b7 feat: comprehensive security fixes for critical vulnerabilities
BREAKING CHANGES:
- Enhanced logging system with comprehensive data sanitization
- Atomic key generation with race condition protection
- Strengthened mutex system implementation
- Complete IV reuse prevention system
- Secured global API with multi-layer protection
- Enhanced memory management with secure wiping
- Improved error handling without information disclosure

Security Fixes:
• CRITICAL: Fix logging system data leakage
  - Add comprehensive pattern detection (hex, base64, base58, base32)
  - Implement entropy-based sensitive data detection
  - Add suspicious character distribution analysis
  - Emergency disable logging on security violations
  - Reduce production logging to errors only

• CRITICAL: Resolve race conditions in key generation
  - Implement atomic state checks within mutex protection
  - Add proper waiting mechanism for concurrent operations
  - Validate key generation results before assignment
  - Add operation timeouts and error recovery

• HIGH: Strengthen mutex system implementation
  - Replace silent failures with proper error propagation
  - Add comprehensive mutex system validation
  - Implement authorized emergency unlock mechanisms
  - Enhanced timeout handling with state consistency
  - Add mutex diagnostics and recovery systems

• HIGH: Complete IV reuse prevention system
  - Implement comprehensive IV collision detection
  - Add entropy validation for generated IVs
  - Track IV usage across sessions with cleanup
  - Detect suspicious patterns and weak RNG
  - Emergency mode activation on security violations

• HIGH: Secure global API exposure
  - Multi-layer protection with Proxy-based access control
  - Block internal property access attempts
  - Implement API replacement monitoring and restoration
  - Add method interception protection
  - Comprehensive global namespace monitoring

• HIGH: Enhanced memory management
  - Implement secure memory wiping for all data types
  - Multiple overwrite passes (random, zeros, ones)
  - Secure cleanup of cryptographic materials
  - Force garbage collection where available
  - Track and validate memory cleanup operations

• HIGH: Improve error handling security
  - Categorize errors by security sensitivity
  - Generate safe error messages without internal details
  - Track error frequency for security monitoring
  - Implement secure error message mapping

Additional Security Enhancements:
• Add DTLS ClientHello race condition protection
• Implement enhanced SecureKeyStorage with encryption
• Add comprehensive IV tracking and validation systems
• Create emergency mode systems for security violations
• Enhance cryptographic validation and state management
• Add extensive security diagnostics and monitoring

Performance & Reliability:
• Optimize mutex usage to reduce contention
• Improve error recovery mechanisms
• Add comprehensive system validation
• Enhanced debugging and diagnostic capabilities
• Better resource cleanup and management
2025-08-31 15:52:34 -04:00
lockbitchat
551feb21a4 Security hardening: remove global leaks, enforce crypto, cleanup logs
- Removed unsafe exposure of internal objects:
      • deleted all references to `window.fileTransferSystem`
      • unified global API setup to a single immutable `safeGlobalAPI` via Object.freeze
      • removed legacy branch with `delete window[name]`

    - Logging improvements:
      • eliminated all direct `console.*` calls (use `_secureLog` exclusively)
      • fixed string templates with proper interpolation (``${var}``)
      • prevented accidental fallback to raw console in production

    - Cryptography enforcement:
      • updated `_validateCryptographicSecurity()` to require ECDSA and PFS
      • added emergency shutdown if critical crypto features are missing
      • ensured consistent feature enabling for production
2025-08-28 18:53:16 -04:00
lockbitchat
a265209ff6 fix(security): fixes in keystore and cryptography
- Metadata of extracted keys is now marked encrypted: true
- Removed decryption bypass via _keyReferences, all keys are returned via decrypt
- Nested encryption uses random 96-bit IV instead of single byte increment
- Fixed _secureLogShim: correct argument destructuring (...args)
- Removed busy-wait in forceInitializeFileTransfer, replaced with async wait
2025-08-28 17:01:14 -04:00
lockbitchat
97b87828e2 feat(security): encrypted key storage with WeakMap and SecureKeyStorage
- Added SecureKeyStorage class: JWK storage encrypted (AES-GCM) + WeakMap
- Support for non-extractable keys via secure links without export
- Implemented secure wipe/secure wipe all, statistics collection
- Improved secure logging: blacklist of sensitive fields, whitelist of secure ones
- Integration with WebRTC manager layers and secure key installation
2025-08-28 16:17:40 -04:00
lockbitchat
a4161bc47e SECURITY: Fix console logging vulnerabilities in production mode
- Replace unsafe console.error/warn calls with secure logging system
- Implement production-safe logging that masks sensitive data
- Add automatic sanitization for cryptographic keys and sensitive information
- Create secure logging infrastructure for EnhancedSecureWebRTCManager and EnhancedSecureCryptoUtils
- Prevent data leakage of internal logic and error details in production
- Add production/development mode detection for appropriate logging levels
- Implement server-side error logging for production environments
2025-08-28 15:15:09 -04:00
lockbitchat
e468838596 SECURITY: Fix console logging vulnerabilities in production mode
- Replace unsafe console.error/warn calls with secure logging system
- Implement production-safe logging that masks sensitive data
- Add automatic sanitization for cryptographic keys and sensitive information
- Create secure logging infrastructure for EnhancedSecureWebRTCManager and EnhancedSecureCryptoUtils
- Prevent data leakage of internal logic and error details in production
- Add production/development mode detection for appropriate logging levels
- Implement server-side error logging for production environments
2025-08-28 15:05:42 -04:00
lockbitchat
398d8bc014 Updated application documentation and website homepage to include ASN.1 Validation 2025-08-27 13:25:26 -04:00
lockbitchat
6aaabbd1df feat(security): Implement full ASN.1 validation for key structure verification
BREAKING CHANGE: Enhanced key validation now performs complete ASN.1 parsing

Security improvements:
- Added complete ASN.1 DER parser for full structure validation
- Implemented OID validation for algorithms and curves (P-256/P-384 only)
- Added EC point format verification (uncompressed format 0x04)
- Validate SPKI structure elements count and types
- Check key size limits to prevent DoS attacks (50-2000 bytes)
- Verify unused bits in BIT STRING (must be 0)
- Added fallback support from P-384 to P-256

This fixes high-risk vulnerability where keys with valid headers but
modified data could be accepted. Now all structural elements are validated
according to PKCS standards.

Affected methods:
- validateKeyStructure() - complete rewrite with ASN.1 parsing
- All key import/export methods now use enhanced validation
2025-08-27 12:39:18 -04:00
lockbitchat
0b01083fce Deleting a test method 2025-08-26 21:36:52 -04:00
lockbitchat
984564fae6 feat: add enhanced security validation and timing protection
Security Enhancements:
- Add salt entropy validation (minimum 16 unique bytes for 64-byte salts)
- Expand secure logging patterns to catch more sensitive data types
  (fingerprint, mac, hash patterns)
- Implement random timing delays in verifyAuthProof() to mask execution timing
- Revert sanitizeMessage() to working regex-based approach

Validation Improvements:
- validateSalt() now checks both size and entropy quality
- secureLog.sanitizeContext() enhanced with additional sensitive patterns
- Added timing attack protection with 5-25ms random delays
2025-08-26 19:58:45 -04:00
lockbitchat
1e270fb4b8 security: fix critical vulnerabilities in crypto module
- Remove insecure key import backdoor
- Strengthen password generation (32 chars + special chars)
- Implement constant-time comparisons to prevent timing attacks
- Fix race conditions in rate limiting with atomic operations
- Add input validation and enhanced error handling

BREAKING CHANGE: Remove allowInsecureImport option - all signed packages
now require mandatory signature verification for security.
2025-08-26 19:44:34 -04:00
lockbitchat
e7c6dfc3b3 feat: Implement comprehensive token-based authentication system
Add complete Web3-powered token authentication module for SecureBit project

- **TokenAuthManager.js**: Main authentication manager handling Web3 wallet connections,
  session creation/validation, and automatic session termination
- **Web3ContractManager.js**: Smart contract interface for token operations and validation
- **SecureBitAccessToken.sol**: ERC-721 smart contract for access tokens with monthly/yearly durations

- **TokenAuthModal.jsx**: User interface for wallet connection and token purchase
- **TokenStatus.jsx**: Header component displaying token status and remaining time

- ERC-721 compliant access tokens with configurable durations (1 month/1 year)
- OpenZeppelin security contracts integration (Ownable, ReentrancyGuard, Pausable)
- Token purchase, renewal, and deactivation functionality
- Automatic expiry validation and price management
- Transfer handling with user token tracking
- Pausable functionality for emergency contract control

- `purchaseMonthlyToken()` / `purchaseYearlyToken()`: Token acquisition
- `isTokenValid()`: Real-time token validation
- `renewToken()`: Token extension functionality
- `deactivateToken()`: Manual token deactivation
- `getTokenPrices()`: Dynamic pricing information
- `pause()` / `unpause()`: Emergency control functions

- Web3 signature verification for wallet ownership
- Single active session enforcement per account
- Automatic session termination on new device login
- Cryptographic signature validation
- MITM and replay attack protection preservation
- Blockchain-based token validation

- Modular architecture for easy integration
- Web3.js integration for Ethereum network interaction
- MetaMask wallet support
- Session heartbeat monitoring
- Automatic token expiry handling
- Comprehensive error handling and logging

- src/token-auth/TokenAuthManager.js
- src/token-auth/Web3ContractManager.js
- src/token-auth/SecureBitAccessToken.sol
- src/token-auth/config.js
- src/components/ui/TokenAuthModal.jsx
- src/components/ui/TokenStatus.jsx

- Smart contract includes comprehensive test scenarios
- Mock mode available for development testing
- Hardhat deployment scripts provided
2025-08-24 23:56:12 -04:00
lockbitchat
dde7196bb8 fix: prevent install prompt showing in installed PWA
- Improve installation status detection logic
- Add proper DOM cleanup when PWA is installed
- Enhance monitoring for installation state changes
- Fix shouldShowPrompt() logic to always check current status
- Add forceInstallationCheck() method for manual status updates
2025-08-24 17:07:31 -04:00
lockbitchat
26ba6eebb9 fix: prevent install prompt showing in installed PWA
- Improve installation status detection logic
- Add proper DOM cleanup when PWA is installed
- Enhance monitoring for installation state changes
- Fix shouldShowPrompt() logic to always check current status
- Add forceInstallationCheck() method for manual status updates
2025-08-24 17:04:01 -04:00
lockbitchat
171a7d9dfb Fixed DTLS Race Condition & Memory Safety
 FIXED HIGH CRITICALITY vulnerabilities (October 2024):
- DTLS ClientHello Race Condition: Added source validation
- Memory Safety Issues: Enhanced secure memory cleanup
- Added DTLS protection constants and validation methods
- Improved memory cleanup with secureWipe and zero-filling
- Integrated DTLS protection in handleSecureAnswer
2025-08-24 16:30:06 -04:00
lockbitchat
f7940d25e9 COMPLETE Security Overhaul: File Transfer Module
- Eliminated unsafe global state (window.*)
- Added DoS protection with MessageSizeValidator
- Added race condition prevention with AtomicOperations
- Added rate limiting (10 files/minute)
- Added secure memory management with SecureMemoryManager
- Wrapped handleFileChunk in atomic operations
- Updated all methods with security enhancements
2025-08-24 16:04:49 -04:00
lockbitchat
7fdf7a1b89 Fix non-working PWA modal buttons
- Fixed 'Got it' and 'Later' buttons in iOS Safari modal
- Fixed 'Close' button in fallback instructions modal
- Fixed 'OK' button in final dismissal notification
- Replaced broken inline onclick with proper event listeners
- Added comprehensive button event handling with logging

Bug: Modal buttons were unresponsive due to inline onclick issues
2025-08-23 17:48:46 -04:00
lockbitchat
a28aacbe6e Fix PWA mobile UX and modal button handlers
- Fixed iOS Safari modal buttons not working (removed inline onclick)
- Added 10-second auto-popup for install instructions
- Removed floating install buttons on mobile devices
- Enhanced mobile experience with modal-only approach
- Added proper event listeners for all modal buttons
- Improved cross-platform PWA installation flow

Mobile UX: Modal-only, Desktop: Button + Modal
2025-08-23 17:40:32 -04:00
lockbitchat
959e137171 Add 10-second auto PWA install prompt
- New users now see install prompt automatically after 10 seconds
- Smart cancellation prevents duplicate prompts
- Added PWAUtils methods for delayed prompt management
- Enhanced user onboarding experience
- Respects installation status and user preferences
2025-08-23 17:30:12 -04:00
lockbitchat
434301fe6f 🐛 Fix PWA install prompt showing after installation
Fixed critical bug where PWA install message continued showing after app installation

-  Enhanced PWA installation status detection
-  Fixed install prompt logic to hide after installation
-  Improved Service Worker update handling
-  Added proper installation state management
-  Enhanced iOS Safari PWA detection
-  Added installation preferences storage

- Added installationChecked flag for better state management
- Enhanced checkInstallationStatus() method with multiple detection methods
- Improved shouldShowPrompt() logic to prevent showing after installation
- Added periodic installation monitoring for iOS devices
- Enhanced Service Worker activation event handling
- Added PWAUtils.checkInstallationStatus() utility method

- public/src/pwa/install-prompt.js (major refactor)
- public/index.html (PWA logic improvements)
- public/sw.js (Service Worker enhancements)

- PWA install message no longer shows after successful installation
- Only update notifications are shown for installed PWAs
- Proper distinction between install prompts and update notifications

Version: Enhanced Security Edition v4.01.413
2025-08-23 17:21:32 -04:00
lockbitchat
81b0e4bd3e Translation of the download button into English 2025-08-21 17:45:43 -04:00
lockbitchat
cef5654cf8 Update to pre-release version. Removed logging that was used for debugging. Added typing of files that the user sends with size restrictions. 2025-08-21 17:40:17 -04:00
lockbitchat
430ff2a6af - Removed redundant console.log statements to clean up the code
- Added English comments for better readability and GitHub compatibility
2025-08-21 05:16:41 -04:00
lockbitchat
31485989f7 feat(security): comprehensive connection security overhaul with mutex framework
Implemented robust security framework with custom withMutex system:

**Race condition protection:**
- Custom _withMutex('connectionOperation') implementation with 15s timeout
- Atomic key generation through _generateEncryptionKeys()
- Serialized connection operations to prevent conflicts

**Multi-stage validation pipeline:**
- Step-by-step validation (keys, fingerprints, SDP)
- Automatic rollback via _cleanupFailedOfferCreation() on failures
- Error phase detection for precise diagnostics

**Enhanced MITM protection:**
- Unique encryption key fingerprints
- Session ID anti-hijacking protection
- Mutual authentication challenge system
- Package integrity validation

**Advanced logging & monitoring:**
- Secure logging without sensitive data leaks
- Operation tracking via unique operationId
- Comprehensive error diagnostics and phase tracking
- Deadlock detection with emergency recovery

Breaking changes: Connection establishment now requires mutex coordination
2025-08-21 04:07:16 -04:00
lockbitchat
9b2884a3af implemented secure key storage with WeakMap isolation
- Replaced public key properties (`encryptionKey`, `macKey`, etc.) with private `WeakMap`-based storage
- Added secure access methods: `_initializeSecureKeyStorage()`, `_getSecureKey()`, `_setSecureKey()`
- Implemented validation (`_validateKeyValue()`), rotation (`_rotateKeys()`), and emergency wipe (`_emergencyKeyWipe()`)
- Updated `cleanupConnection()` and `disconnect()` for secure key handling
- Added getters/setters for backward compatibility with existing code
- Integrated key security monitoring via `_startKeySecurityMonitoring()`
- Ensured keys are inaccessible via direct property access or debugger

Fixes: Direct exposure of sensitive keys in memory
Security: Prevents unauthorized access, enforces key lifetime limits
2025-08-21 00:06:28 -04:00
lockbitchat
7ee5ec6208 Security: Implement secure logging to prevent data leaks in console
- Add production mode detection and secure logging system
- Replace console.log with _secureLog() that sanitizes sensitive data
- Hide encryption keys, message content, and security details from logs
- Implement log level control (production: warn+error only, dev: debug+)
- Add data sanitization for keys, tokens, buffers, and sensitive strings
- Prevent log spam with automatic rate limiting and cleanup
- Maintain useful debugging info while protecting user privacy
- Add automatic memory cleanup for log counters

Security Impact: HIGH - Prevents sensitive data exposure through browser console
Changes:
- Production: Only critical errors/warnings logged
- Development: Safe debugging info without sensitive content
- All message content, encryption keys, and tokens are now sanitized
- Automatic detection of production vs development environment
2025-08-20 23:34:56 -04:00
lockbitchat
73850f423c Security: Fix critical global exposure vulnerability in WebRTC Manager
- Remove dangerous global window exposure of encryption keys and manager instance
- Replace window.webrtcManager/globalWebRTCManager with secure limited API
- Add window.secureBitChat with validated public methods only
- Implement automatic monitoring for unauthorized global exposure attempts
- Add security integrity checks and emergency shutdown capability
- Prevent access to sensitive data (encryption keys, session data, internal methods)
- Maintain full functionality while securing internal implementation

BREAKING CHANGE: window.webrtcManager is no longer available
MIGRATION: Use window.secureBitChat.sendMessage() instead of window.webrtcManager.sendMessage()

Security Impact: CRITICAL - Prevents XSS attacks from accessing encryption keys
Tested: All functionality preserved, file transfers working, connections stable
2025-08-20 23:04:29 -04:00
lockbitchat
241212a315 🔧 Improve file transfer system integration and message handling
- File Transfer Integration: Refactored file transfer system initialization with better error handling and automatic retry mechanisms
- Message Filtering: Added comprehensive message filtering system to prevent file transfer and system messages from appearing in chat UI
- Callback System: Simplified file transfer callback system - removed progress notifications from chat to reduce noise
- System Message Deduplication: Implemented notification flags to prevent duplicate system messages (verification, security upgrades, etc.)
- Error Handling: Enhanced error handling with graceful fallbacks instead of throwing exceptions that could break connections
- UI Message Delivery: Added `deliverMessageToUI()` method with built-in filtering for system/file messages
- DataChannel Event Handling: Improved onmessage handler with early filtering for file transfer messages
- Global Integration: Better integration with global file transfer system (`window.fileTransferSystem`)
- Connection Stability: Removed aggressive reconnection attempts that could cause session closure
- Debug Logging: Enhanced debug logging for better troubleshooting

- File transfer messages now bypass chat UI entirely
- System messages are deduplicated using internal flags
- Better separation of concerns between WebRTC and file transfer systems
- More robust initialization sequence with proper cleanup
- Improved message routing and processing pipeline

- Fixed duplicate system notifications
- Resolved file transfer message leakage into chat
- Improved connection state management
- Better handling of initialization race conditions
2025-08-20 18:19:42 -04:00
lockbitchat
773215264f Improved chat UX/UI:
- Fixed message auto-scroll bug when receiving new messages
- Adjusted bottom chat section integration with proper styles
- Updated bottom chat section layout and appearance
- Hidden scrollbars for better interaction and cleaner look
2025-08-20 03:53:58 -04:00
lockbitchat
94ca53f6ca Improve chat UI for secure channel creation pages
Fix iOS PWA installation and improve cross-platform compatibility

- Fix manifest.json paths (use relative paths with ./ for iOS)
- Update Apple Touch Icons structure to use organized folders
- Add missing 180x180px icon requirement for iOS
- Fix apple-mobile-web-app meta tags configuration
- Add viewport-fit=cover for iPhone X+ notch support

- Fix missing showInstallButton() method causing TypeError
- Add complete showInstallBanner() and createInstallBanner() methods
- Implement proper hideInstallPrompts() functionality
- Add iOS-specific installation instructions modal
- Fix event handling for install prompt dismissal

- Restructure PWA icons into platform-specific folders:
  - ./logo/pwa/ios/ for Apple Touch Icons
  - ./logo/pwa/android/ for Android launcher icons
  - ./logo/pwa/windows11/ for Microsoft Tiles
- Update manifest.json to reference correct icon paths
- Add browserconfig.xml for Windows 11 tile configuration

- Improve PWA registration script without conflicts
- Add proper error handling for offline functionality
- Integrate with existing PWA modules (install prompt, offline manager)
- Add update notifications for new app versions

- Enhanced detection for iOS Safari vs other browsers
- Improved installation flow for different platforms
- Better user feedback for unsupported installation methods
- Added fallback instructions for manual installation

- Add comprehensive PWA support detection
- Implement proper iOS standalone mode detection
- Add console logging for installation status tracking
- Include developer utilities for PWA management

Tested on: iOS Safari, Chrome, Edge, Firefox
Resolves iOS PWA installation issues and improves overall PWA experience."
2025-08-19 21:54:17 -04:00
lockbitchat
22b89e0a9d new API keys for test 2025-08-19 11:57:08 -04:00
lockbitchat
fe611f7630 Refactored file encryption/decryption logic for P2P transfers
- Reworked the core logic for encrypting and decrypting files exchanged between users
- Improved key derivation and session handling for file chunks
- Enhanced integrity checks to prevent tampering and replay attacks
- Work in progress: adding hardened encryption schemes and conducting fault-tolerance testing
2025-08-18 23:56:10 -04:00
lockbitchat
dadc80a755 wip(encryption): experimental support for encrypted file transfer via chunks
Added an early implementation of secure file transfer using chunk-based encryption.
Files are split into encrypted chunks and transmitted over the chat channel.

This feature is still under active development and requires further changes and testing.
2025-08-18 21:45:50 -04:00
lockbitchat
857d7d74ab Encryption module control system & session timer improvements
- Added a real verification system for active encryption modules, giving users full control over enabled modules.
- During session purchase or activation, the actual enabled modules are now displayed for both free and paid sessions.
- Refactored session timer initialization for proper functionality and accurate countdown.
- Optimized code structure related to session management and module verification.
2025-08-17 20:38:47 -04:00
lockbitchat
3c25b4565d feat: Add comprehensive PWA support with offline functionality
- Add manifest.json with full PWA configuration
  - Support for installation on all platforms (iOS, Android, Desktop)
  - Custom app icons (72x72 to 512x512) with maskable support
  - App shortcuts for quick actions (Create/Join Channel)
  - Protocol handlers for web+securebit:// links
  - Share target integration

- Implement enhanced Service Worker (v4.0)
  - Smart caching strategies (cache-first, network-first, stale-while-revalidate)
  - Security-aware caching (excludes sensitive endpoints)
  - Background sync for failed requests
  - Offline fallbacks with custom error handling
  - Response cloning fixes and CORS handling

- Add PWA Install Prompt Manager
  - Cross-platform install detection and prompts
  - iOS Safari specific installation guide
  - Smart dismissal logic with retry mechanisms
  - Install success notifications and user guidance
  - Persistent install preferences with localStorage

- Implement comprehensive Offline Manager
  - IndexedDB for offline data persistence
  - Automatic message queuing and sync when online
  - Session state recovery after connection loss
  - WebRTC reconnection handling
  - Real-time connection status indicators
  - Offline guidance and help system

- Add offline-first features
  - Message queue with priority and retry logic
  - Session data preservation during disconnection
  - Application state recovery
  - Background sync registration
  - Periodic cleanup of old offline data

- Enhanced user experience
  - Connection status notifications
  - Offline mode guidance and help
  - Automatic sync notifications
  - Reconnection progress indicators
  - Platform-specific installation instructions

This implementation ensures SecureBit.chat works seamlessly offline while maintaining security and providing a native app-like experience across all platforms.
2025-08-17 16:04:45 -04:00
lockbitchat
adb1844392 Update session pricing and demo mode
- Updated demo mode: now includes basic protection features, still stronger than many competing messengers.
- Adjusted pricing for Basic and Premium sessions to better reflect security levels.
- Added restrictions to Basic session and enhanced Premium session to deliver maximum protection.
2025-08-17 02:22:55 -04:00
lockbitchat
2040228892 Open Graph update 2025-08-17 00:33:12 -04:00
lockbitchat
9f463c6672 Adding a new block that shows which platforms are under development, and in the future, when users click on the interactive elements of the block, they will be directed to marketplaces or download the applications to their computer. 2025-08-17 00:10:33 -04:00
lockbitchat
12de75f882 Technical comments removed 2025-08-16 21:15:03 -04:00
lockbitchat
e4273f5150 Major Security Improvements:
- Enhanced user fingerprinting with WebGL, Canvas, and Audio fingerprinting
- Hardware binding to prevent F5/Ctrl+F5 abuse
- Persistent storage across browser sessions (localStorage + sessionStorage)
- Global demo session counter with 10 session limit per device
- Multi-tab protection (max 2 tabs simultaneously)
- Anti-reset protection with hardware mismatch detection

Demo Session Protection:
- Advanced fingerprint generation with CPU benchmarking
- Enhanced validation with cryptographic verification
- Automatic cleanup and session completion tracking
- Cooldown periods between sessions (1min + 15min completion)
- Weekly partial reset of global counters

Fixes:
- Fixed SessionTimer console spam after connection disconnect
- Added missing registerEnhancedDemoSessionUsage method
- Corrected method calls from generateUserFingerprint to generateAdvancedUserFingerprint
- Implemented proper event handling for connection state changes

WebRTC Improvements:
- Added peer-disconnect, new-connection, and connection-cleaned events
- Enhanced connection cleanup with proper UI notifications
- Fixed SessionTimer state management during disconnections
- Prevented infinite re-rendering and console logging

Performance Optimizations:
- Auto-save persistent data every 30 seconds
- Periodic cleanup of old session data (every 6 hours)
- Memory management for used preimages (10k limit)
- Tab heartbeat system for multi-tab detection

Testing:
- Demo sessions now properly enforce limits
- P2P anonymity maintained (no server validation)
- Compatible with incognito mode restrictions
- Resistant to common abuse techniques
2025-08-16 20:58:42 -04:00
lockbitchat
32635839c6 this part will be transferred for development as a separate module and will later be implemented into the application 2025-08-16 19:20:20 -04:00
SecureBitChat
738d5cbb35 Delete src/enhanced-secure-crypto/pkg directory 2025-08-15 01:30:17 -04:00
SecureBitChat
309578130c Update .gitattributes 2025-08-15 01:26:50 -04:00
SecureBitChat
b452cf1ab4 Create .gitattributes 2025-08-15 01:25:38 -04:00
lockbitchat
15f9d1bde6 Added Rust module sources 2025-08-15 01:18:26 -04:00
lockbitchat
573b766fc4 feat: Introduce Rust+WebAssembly cryptographic module
🔐 **Enhanced Security & Performance**
- Developed new crypto module in Rust to replace pure JavaScript implementation
- Leverages WebAssembly for near-native performance (~5-7x faster than JS)
- Provides memory safety and sandboxed execution environment

🛠️ **Technical Implementation**
- AES-256-GCM encryption with 100,000 PBKDF2 iterations
- ECDSA P-384 digital signatures with SHA-384
- Cryptographically secure random number generation
- Input sanitization and rate limiting

📦 **Module Structure**
- `/src/enhanced-secure-crypto/` - Rust source code
- `/pkg/` - Generated WASM binaries and JS bindings
- Integration examples and demo pages included

⚠️ **Development Status**
- Module compilation and basic functionality verified
- NOT YET INTEGRATED with main application codebase
- Requires thorough testing before production deployment
- JavaScript fallback remains active

**Next Steps:**
- [ ] Integration testing with existing SecureBit.chat codebase
- [ ] Performance benchmarking
- [ ] Security audit
- [ ] Migration strategy development

Co-developed with AI assistance for cryptographic best practices.
2025-08-15 01:03:12 -04:00
lockbitchat
5437bef9c5 feat: Enhanced demo mode security and vulnerability fixes
- **Fixed demo mode timing attack vulnerability** - Added strict rate limiting and user fingerprinting
- **Eliminated replay attack vectors** - Implemented preimage tracking and expiration validation
- **Enhanced key reuse protection** - Added cryptographic validation and session isolation
- **Strengthened free tier abuse prevention** - Multi-layer cooldown system with global limits

- **Secure user fingerprinting** - Browser-based identification without privacy invasion
- **Global session limits** - Maximum 10 concurrent demo sessions across all users
- **Per-user daily limits** - 3 demo sessions per 24 hours with smart cooldown
- **Session completion tracking** - Prevents rapid reconnection abuse
- **Enhanced preimage generation** - Timestamped, versioned, and entropy-validated

- **Configurable security layers** - Individual toggle for encryption, obfuscation, and traffic features
- **Debug mode controls** - `window.DEBUG_MODE` for detailed logging and diagnostics
- **Emergency security disable** - Graceful fallback when advanced features cause issues
- **Vulnerability testing support** - Controlled security layer bypass for penetration testing

- **Cross-session compatibility** - Works seamlessly with both paid and free sessions
- **Real-time UI updates** - Synchronized timer display across all components
- **Session state management** - Automatic cleanup and notification system
- **Payment integration** - Smooth transition between demo and paid sessions

- **Layered security architecture** - 7+ configurable security features with independent controls
- **Traffic analysis protection** - Advanced obfuscation with fake traffic and packet padding
- **Connection state monitoring** - Enhanced logging for security audit and debugging
- **Fallback mechanisms** - Robust error handling with security-first degradation

- **Structured security logs** - Detailed audit trail for security events
- **Performance monitoring** - Connection state and encryption layer metrics
- **Attack detection logging** - Comprehensive tracking of security violations
- **Development diagnostics** - Enhanced debugging for faster development cycles

- Refactored `PayPerSessionManager` with enhanced security controls
- Added `generateUserFingerprint()` with privacy-preserving identification
- Implemented `checkDemoSessionLimits()` with multi-tier validation
- Enhanced `EnhancedSecureWebRTCManager` with configurable security layers
- Added emergency security disable functionality for testing environments
- Improved session timer with cross-component synchronization

**Breaking Changes:** None - All changes are backward compatible
**Security Impact:** High - Eliminates critical vulnerabilities in free tier
**Testing Impact:** Significantly improved - New debug modes and security layer controls
2025-08-14 23:34:54 -04:00
lockbitchat
19e3047282 feat: rebrand to SecureBit.chat due to name conflict
BREAKING CHANGE: Project renamed from LockBit.chat to SecureBit.chat

- Changed project name to avoid confusion with LockBit ransomware group
- Updated all documentation, branding, and references
- Maintained all existing functionality and security features
- Domain migration planned to securebit.chat

Reason: The LockBit name became associated with a notorious ransomware
group, causing conflicts on platforms and potential confusion for users.
SecureBit better reflects our mission of providing secure P2P messaging
while avoiding negative associations.

This change affects:
- README.md and all documentation
- Package.json name field
- Brand assets and logos
- Website references
- Social media handles

Core functionality remains unchanged:
 12-layer military-grade security
 Lightning Network integration
 P2P WebRTC architecture
 Open source MIT license
2025-08-14 15:54:11 -04:00
lockbitchat
27428cdb0e Update main page after 4.0 release 2025-08-14 04:45:39 -04:00
lockbitchat
baa4879e2c Create CRYPTOGRAPHY doc
date log file and translate to english
2025-08-14 04:01:08 -04:00