Previous version was v0.0.1.1 New version is v0.0.2.1 (don't ask me why I skipped v0.0.2.0) The most significant change is that the key derivation for the basis is now split into two keys. One key is used for the page table ECB encoding, and a different key is used for the data AES-GCM-SIV encoding. This is because someone much smarter than me looked at my scheme and said it is very dangerous to use the same key for two different types of ciphers. This person is correct, so it had to be rectified. For the System Basis, the keys are encrypted using the root keys wrapper API. In this case, we simply create two random keys, one for the page table, and one for the data region, and wrap them using the root keys API. For user secret Basis, the derived keys are sent through HKDF with two different "info" strings to derive a pair of keys from a common password. In case the cryptographer who looked at this is reading along, note that the basis name is encoded as a fixed-length, 0-padded record, so, we don't encode the length of the basis in the hash used to derive the keys. When I explained the scheme I thought I was using a variable-length basis name to derive the key, but when I checked the code, it's always 64 bytes long, and bytes that are not used are 0-padded, so, I think we don't need the length encoding field. |
||
|---|---|---|
| .. | ||
| locales | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
PDDB
Documentation for the PDDB can be found in the headers of the source files:
- main.rs contains a glossary, project overview, threat model, auditor's notes, and goals.
- basis.rs gives details on how the data is organized in the Basis memory space, and contains most of the code for manipulating dictionary entries stored within the basis cache.
- dictionary.rs will contain most of the code for manipulating the keys stored in a dictionary cache entry.
- keys.rs documents the key cache format and on-disk metadata and data formats.
- pagetable.rs documents the page table format.
- hw.rs contains all the glue to the SPINOR layer, TRNG, and system time, as well as low-level routines for formatting the disk.
- fastspace.rs contains the Fast Free Space optimization, which is a partial record of known free space in the PDDB. The very nature of plausible deniability requires this quirky structure, as "free space" is the side channel for leaking information about the existence, or lack of existence, of certain data.
Why is your RustDoc so Shitty?
Unfortunately, rustdoc can't document binaries,
and so the only documentation you'll see generated are for the "frontend" library
portions, which are the API calls you would use to talk to the PDDB. These are
deliberately uninteresting, as we've gone through great effort to make
the bindings are "what you expect" (principle of least surprise).
However, you're probably looking to fix a PDDB bug, audit the code, or generally figure out what the hell is going on. This means you want to look at the PDDB as a "binary" and not a "library" -- something RustDoc can't help you with. As the issue above notes, the fallback is for you to consult this README file, and literally, read the source (or rather, the paragraphs of plaintext documentation we've embedded in the source files, waiting for the day when the rustdoc issue is fixed and these can be turned into something more user-friendly).