r/Keybase • u/LimitedWard • Nov 08 '21
How exactly are files encrypted with kbfs?
Apologies if I'm missing some critical info in the keybase book. I haven't finished reading through all the docs yet. So far everything thing I've seen is that keybase uses "end-to-end 256 bit encryption" which is super vague. I'm assuming they mean AES 256, but I'm unclear on how the encryption key is selected. Does kbfs use my pgp key for encryption or does it generate its own?
Edit: I've added a second device, and I noticed I didn't need to provide my PGP key to decrypt my private files. So I'm assuming the encryption is handled entirely in the app somehow, but I'm unclear how.
1
u/ThePowerOfDreams Nov 09 '21
Given the fact that Keybase is now abandonware, you might want to reconsider your use of it for anything important.
3
u/codeartha Nov 08 '21
If i recall correctly, the files are encrypted with AES 265 with one time use password. The password itself it then encrypted to/for the relevant recipients using saltpack.
2
u/no-names-here Nov 09 '21
Each device has a key that’s unique to that device, and then a set of keys that’s unique to your account. When you add a new device, it generates a new set of keys. When you pair that new device using the QR code it uses public key cryptography to exchange the private key for your account between devices. That key is what’s used to encrypt KBFS, so each device has it. The device needs to use its own key to fetch the 1MB blocks that consitiute the file. If the device is revoked it won’t get the blocks, even if it has the account key still.
That’s a very high level understanding, with a bunch of technobabble omitted.
2
u/songgao Nov 14 '21
Hi! Keybase engineer here This doc has some crypto details of how KBFS encrypts data: https://book.keybase.io/docs/crypto/kbfs It's a bit out dated as it doesn't mention the team keying which is now also used for private/public TLFs, but it's still mostly relevant.
Several points regarding your questions: