mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-24 22:45:19 +00:00
Update BRING_THE_NOISE.md
This commit is contained in:
@@ -128,16 +128,6 @@ let encrypted = try noiseService.encrypt(messageData, for: peerID)
|
||||
let decrypted = try noiseService.decrypt(encryptedData, from: peerID)
|
||||
```
|
||||
|
||||
### Channel Encryption
|
||||
|
||||
Password-protected channels use Noise for key distribution:
|
||||
|
||||
```swift
|
||||
// Share channel key securely
|
||||
let keyPacket = createChannelKeyPacket(password: password, channel: channel)
|
||||
let encrypted = try encrypt(keyPacket, for: peerID)
|
||||
```
|
||||
|
||||
## Security Properties
|
||||
|
||||
### Forward Secrecy
|
||||
@@ -157,15 +147,6 @@ let encrypted = try encrypt(keyPacket, for: peerID)
|
||||
|
||||
## Implementation Details
|
||||
|
||||
### Key Derivation
|
||||
```swift
|
||||
// HKDF for key derivation
|
||||
func hkdf(salt: Data, ikm: Data, info: Data, length: Int) -> Data
|
||||
|
||||
// Derive channel keys with PBKDF2
|
||||
func deriveChannelKey(password: String, salt: Data) -> SymmetricKey
|
||||
```
|
||||
|
||||
### Cryptographic Primitives
|
||||
- **DH**: X25519 (Curve25519)
|
||||
- **Cipher**: ChaChaPoly (AEAD)
|
||||
|
||||
Reference in New Issue
Block a user