mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 17: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)
|
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
|
## Security Properties
|
||||||
|
|
||||||
### Forward Secrecy
|
### Forward Secrecy
|
||||||
@@ -157,15 +147,6 @@ let encrypted = try encrypt(keyPacket, for: peerID)
|
|||||||
|
|
||||||
## Implementation Details
|
## 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
|
### Cryptographic Primitives
|
||||||
- **DH**: X25519 (Curve25519)
|
- **DH**: X25519 (Curve25519)
|
||||||
- **Cipher**: ChaChaPoly (AEAD)
|
- **Cipher**: ChaChaPoly (AEAD)
|
||||||
|
|||||||
Reference in New Issue
Block a user