Next: , Previous: , Up: Top  


EBlob format

Eblob is an encrypted blob (binary large object, in the terms of databases), holding any kind of symmetrically encrypted data with the passphrase used to derive the key. It is used to secure configuration files, holding valuable private keys, allowing them to be transferred safely everywhere.

In fact it uses two factors for securing the data:

Whole security depends on the passphrase itself. Pay attention that this is not the password. Password is a short string of high entropy (highly random) characters, but passphrase is (very) long string of low-entropy characters. Low-entropy text is much more easier to remember, and its length provides pretty enough entropy as a result.

Password strengthening function is applied to that passphrase to mitigate brute-force and dictionary attacks on it. Here, Balloon memory-hard password hashing function is used, together with BLAKE2b-256 hash. It has proven memory-hardness properties, very easy to implement, resistant to cache attacks and seems more secure than Argon2 (Password Hashing Competition winner).

Eblob is an XDR-encoded structure:

+-------+------------------+------------+
| MAGIC | S | T | P | SALT | BLOB | MAC |
+-------+------------------+------------+
XDR typeValue
Magic number8-byte, fixed length opaque dataN N C P B 0x00 0x00 0x02
S, T, Punsigned integerSpace cost, time cost and parallel jobs number
Salt32 bytes, fixed length opaque dataRandomly generated salt
Blobvariable length opaque dataEncrypted data itself
MAC32 bytes, fixed length opaque dataBLAKE2b-256 MAC of encrypted blob
  1. generate the main key using balloon(BLAKE2b-256, S, T, P, salt, password)
  2. initialize BLAKE2Xb XOF with generated main key and 96-byte output length
  3. feed N N C P B 0x00 0x00 0x02 magic number to XOF
  4. read 32-bytes of blob encryption key
  5. read 64-bytes of blob authentication key
  6. encrypt the blob using ChaCha20. Blob is splitted on 128 KiB blocks. Each block is encrypted with increasing nonce counter
  7. authenticate ciphertext with MAC

Next: , Previous: , Up: Top