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
This commit is contained in:
lockbitchat
2025-08-18 23:56:10 -04:00
parent dadc80a755
commit fe611f7630
2 changed files with 185 additions and 388 deletions

View File

@@ -4053,6 +4053,18 @@ handleSystemMessage(message) {
console.log('✅ Session activation handled successfully');
if (this.fileTransferSystem && this.isConnected()) {
console.log('🔄 Synchronizing file transfer keys after session activation...');
if (typeof this.fileTransferSystem.onSessionUpdate === 'function') {
this.fileTransferSystem.onSessionUpdate({
keyFingerprint: this.keyFingerprint,
sessionSalt: this.sessionSalt,
hasMacKey: !!this.macKey
});
}
}
} catch (error) {
console.error('❌ Failed to handle session activation:', error);
}