Commit Graph

189 Commits

Author SHA1 Message Date
lockbitchat
d2830b9c46 Optimize JSON and QR codes
- Replaced original JSON with minimized binary format (gzip + base64).
- Adjusted rendering and QR code generation for compatibility.
- Reduced payload size for improved efficiency.
2025-10-05 06:21:14 -04:00
lockbitchat
ec04bebf22 Update UX/UI slider 2025-10-03 00:07:11 -04:00
lockbitchat
8cd78a2aba Update slider UX/UI 2025-10-02 21:34:45 -04:00
lockbitchat
4359e5fab1 Add Testimonials section with user feedback 2025-10-02 19:39:40 -04:00
lockbitchat
78769b58ef UX/UI update 2025-10-02 16:58:09 -04:00
lockbitchat
afc873761f update 2025-10-02 16:52:42 -04:00
lockbitchat
7682f57889 feat(ui): add glowing border effect and improve card hover interactions
- implemented glowing border effect on cards when cursor is near
- multiple cards can glow simultaneously within proximity
- smooth fade-out without flicker on mouse leave
- improved hover animation for better user experience
2025-10-02 16:52:31 -04:00
lockbitchat
6bed472e09 feat(security): implement core crypto and logging hardening
- removed all logging of raw IV, JWK, session tokens, verification codes
  → logs now only include error codes, timestamps and short non-reversible SHA-256 hashes (first 4 bytes)
- replaced global master key storage with PBKDF2-derived non-extractable AES key
  → master key lives only in session memory and is cleared on timeout/focus-out
- added password-based derivation (PBKDF2) for master key initialization
- migrated persistent key storage to AES-GCM wrapped ciphertext in IndexedDB
  → JWK export → encrypt with session master key → store ciphertext + IV + metadata
  → unwrap + import as non-extractable on restore
- removed busy-wait loops and direct `window.gc()` calls
  → replaced with async non-blocking cleanup via setTimeout/Promise/WebWorker
2025-10-02 03:25:38 -04:00
lockbitchat
65cc136b99 chore: remove debug logging and disable debug mode for production
- Removed temporary console logs used for debugging
- Disabled DEBUG_MODE flag
- Updated configuration to run in production mode
- Cleaned up leftover debug utilities to reduce noise in console
2025-10-02 01:43:32 -04:00
lockbitchat
5ce6db1640 update 2025-10-01 23:27:59 -04:00
lockbitchat
0dde4906d9 update UX/UI 2025-10-01 23:26:07 -04:00
lockbitchat
0a7a830b52 Update UX/UI landing page 2025-10-01 20:20:15 -04:00
lockbitchat
49347b5c78 Uopdated version to v4.2.12 - ECDH + DTLS + SAS 4.2.12 2025-09-30 14:18:01 -04:00
lockbitchat
85d900727d Update v4.2.12 2025-09-30 14:13:23 -04:00
lockbitchat
7902359c48 feat(qr-exchange): improved QR code exchange system
- Updated connection flow between users via QR codes
- Added manual switching option in QR code generator
- Increased number of QR codes for better readability
2025-09-27 19:07:17 -04:00
lockbitchat
0ce05b836b Update delete old laying visual files 2025-09-24 10:48:32 -04:00
lockbitchat
34094956b7 feat(core): update session, security system and QR exchange
- Removed session creation and Lightning payment logic
- Refactored security system:
  * no more restrictions
  * all systems enabled on session creation
- Improved QR code exchange for mobile devices
2025-09-23 20:01:02 -04:00
lockbitchat
804b384271 feat: implement build system and development workflow
- Add npm scripts for CSS/JS compilation (build:css, build:js, build)
- Create PowerShell build automation script
- Document development workflow in README
- Add troubleshooting guide for build issues
- Specify proper file structure and compilation process

Supports Tailwind CSS v3.4.0 and esbuild bundling with source maps.
2025-09-08 19:22:50 -04:00
lockbitchat
5034386ee6 Update 2025-09-08 16:40:39 -04:00
lockbitchat
14b6ae2337 Add to CSP
report-uri /csp-report;
report-to csp-endpoint;">
2025-09-08 16:10:26 -04:00
lockbitchat
0f8399ec88 feat(security,ui): self-host React deps, Tailwind, fonts; strict CSP; local QR; better selection state
Replace CDN React/ReactDOM/Babel with local libs; remove Babel and inline scripts
Build Tailwind locally, add safelist; switch to assets/tailwind.css
Self-host Font Awesome and Inter (CSS + woff2); remove external font CDNs
Implement strict CSP (no unsafe-inline/eval; scripts/styles/fonts from self)
Extract inline handlers; move PWA scripts to external files
Add local QR code generation (qrcode lib) and remove api.qrserver.com
Improve SessionTypeSelector visual selection (highlighted background and ring)
Keep PWA working with service worker and offline assets
Refs: CSP hardening, offline-first, no external dependencies
2025-09-08 16:04:58 -04:00
lockbitchat
3458270477 deleting unnecessary comments 2025-09-08 11:45:32 -04:00
lockbitchat
e2316f6557 **What Changed:**
- **Removed:** All libsodium dependencies and PAKE-based authentication
- **Replaced With:** ECDH + DTLS + SAS triple-layer security system
- **Impact:** Eliminates complex PAKE implementation in favor of standardized protocols

**Security Benefits:**
-  **Simplified Architecture** - Reduced attack surface
-  **Standards Compliance** - RFC-compliant protocols
-  **Better Maintenance** - Native Web Crypto API usage
-  **Enhanced Security** - Triple-layer defense system

**New Features:**
- **Elliptic Curve Diffie-Hellman** using P-384 (secp384r1)
- **Cryptographically secure** key pair generation
- **Perfect Forward Secrecy** with session-specific keys
- **MITM resistance** requiring knowledge of both private keys
4.02.985
2025-09-04 17:25:01 -04:00
lockbitchat
0d029f5d39 delet test_method 2025-09-01 17:14:16 -04:00
lockbitchat
beb5bcfd01 fix: resolve message sending - _createMessageAAD method not found
- Move methods to constructor for early availability
- Add connectionId initialization
- Remove duplicate definitions
- Fix AAD creation for anti-replay protection
2025-09-01 17:14:04 -04:00
lockbitchat
77c19c4d71 CRITICAL: Fix major security vulnerabilities
- Remove forced session verification bypass (MITM)
- Implement mandatory file message encryption with AAD
- Add DTLS fingerprint validation and SDP parsing
- Implement hard security gate for unverified connections
- Add emergency key wipe on security breaches
2025-09-01 16:04:33 -04:00
lockbitchat
a04fc16d58 Security Update 2025-09-01 15:15:42 -04:00
lockbitchat
14b001710a feat(security): strengthen crypto, entropy checks, and memory cleanup
- Added constant-time key validation to prevent timing attacks
- Improved randomization (crypto.getRandomValues, larger noise patterns)
- Optimized IV cleanup with batch processing and shorter lifetime
- Added multi-dimensional entropy analysis with quantum-resistant checks
- Enhanced emergency cleanup with atomic operations and rollback
2025-08-31 19:37:26 -04:00
lockbitchat
35d83d46f2 feat(security): Implement input validation and fix logging conflicts
- Added comprehensive input validation with size/rate limits
- Fixed logging conflicts by renaming _sanitizeString → _sanitizeInputString
- Implemented XSS/injection protection via pattern detection
- Added safe logging recovery mechanism
- Maintained all existing security protections
2025-08-31 18:35:31 -04:00
lockbitchat
6c4d0eeaee feat(security): harden API export, remove global flags, unify scheduler
- Removed reliance on window.DEBUG_MODE and window.DISABLE_* flags.
- Configuration is now passed via constructor instead of global variables.
- Exposed API remains on `window.secureBitChat`, but without backup globals or hidden toggles.
- Consolidated multiple setInterval tasks into a single scheduler to reduce attack surface.
- Added strict limits for IV history and log storage to prevent memory exhaustion.
- Improved XSS hardening: no more global switches to disable security features.
2025-08-31 18:01:46 -04:00
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
f368defcf1 Update iOS Splash Screens 2025-08-24 15:22:53 -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