What Exists Today

BuddyDrive currently has these security layers:

Component Algorithm Purpose
Direct peer transportlibp2p NoiseEncrypt direct libp2p connections
Folder content encryptionlibsodium crypto_secretbox (XSalsa20-Poly1305)Encrypt filenames and file contents stored on buddy's machine
Path encryptionDeterministic nonce from folderKey + pathSame path always encrypts to same ciphertext (enables move detection)
Chunk encryptionRandom nonce per 64KB chunkPrevents nonce reuse across file versions
Recovery config backuplibsodium crypto_secretboxEncrypt config synced to relay
Pairing codeShared secretMatch buddies, derive discovery keys, HMAC-authenticate relay records, and relay fallback sessions
Recovery phrase12-word mnemonicRe-derive recovery metadata on a new machine

Recovery Phrase And Master Key

  1. BuddyDrive generates a 12-word recovery phrase
  2. It derives a master key from that phrase
  3. It stores recovery metadata in config.toml
  4. It encrypts your serialized config before syncing it to the relay

When you later run buddydrive recover, BuddyDrive uses the same 12 words to derive the same recovery material, fetches the encrypted config from the relay, decrypts it locally, and writes the restored config.

Control API Access

The control API binds to all interfaces (default port 17521):

The secret provides basic protection but is low-entropy (32 bits). Only access the web GUI on trusted networks or over localhost.

Pairing And Direct Connections

Current Scope And Limits

When encrypted = false (sharing mode), files are stored plaintext on the buddy's machine. Pair only with buddies you trust for unencrypted folders.

What Your Buddy Can See Today

When folder encryption is enabled (default):

Your buddy cannot see:

Your buddy can see:

When folder encryption is disabled (encrypted = false):

Threat Model

What We Protect Against

Network interception on direct libp2p connections: Noise protects direct peer transport.

Buddy reading your files: folder encryption (XSalsa20-Poly1305) makes filenames and content opaque to the storage buddy.

Relay compromise for config backup: the relay stores an encrypted config blob; without the recovery phrase-derived master key it should not be readable.

Lost machine: recovery lets you rebuild config on a replacement device and then resync missing files.

What We Do Not Protect Against

Untrusted buddies with unencrypted folders: if you pair with someone you do not trust and use encrypted = false, they can read your synced files.

Your machine compromised: malware on your machine can read files before or during sync.

Denial of service: an attacker can still prevent peers from connecting.

Secure Pairing Guidelines

  1. Share codes verbally or in person when possible
  2. Verify identity through a second channel
  3. Use unique codes for each buddy relationship
  4. Check buddy IDs on both machines

Security Checklist

Bottom Line

BuddyDrive protects direct libp2p transport with Noise, encrypts relay-backed recovery config with your master key, and encrypts folder filenames and contents with XSalsa20-Poly1305 before storing them on your buddy's machine. Your buddy sees only opaque encrypted blobs. Set encrypted = false only for active collaboration with buddies you trust.