xous-core/services/pddb/Cargo.toml
bunnie 7553053f29 v0.0.2.1 initial implementation - still needs migration code
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.
2022-04-18 15:59:15 +08:00

74 lines
2.5 KiB
TOML

[package]
name = "pddb"
version = "0.1.0"
authors = ["bunnie <bunnie@kosagi.com>"]
edition = "2018"
description = "Plausibly Deniable Database"
# Dependency policy: fully specify dependencies to the minor version number
[dependencies]
bitflags = {version = "1"}
xous = { path = "../../xous-rs" }
xous-ipc = { path = "../../xous-ipc" }
log-server = { path = "../log-server" }
ticktimer-server = { path = "../ticktimer-server" }
xous-names = { path = "../xous-names" }
log = "0.4.14"
num-derive = {version = "0.3.3", default-features = false}
num-traits = {version = "0.2.14", default-features = false}
susres = {path = "../susres"}
rkyv = {version = "0.4.3", features = ["const_generics"], default-features = false}
trng = {path = "../trng"}
spinor = {path = "../spinor"}
aes = {path="../aes"}
rand_core = "0.5.1"
root-keys = {path="../root-keys"}
cipher = "0.3.0"
bitfield = "0.13.2"
aes-gcm-siv = "0.10.3"
llio = {path="../llio"}
subtle = {version = "2.4.1", default-features = false}
tts-frontend = {path="../tts"}
# passwords
sha2 = {path = "../engine-sha512"}
digest = "0.9.0"
hkdf = "0.11.0"
zeroize = "1.3.0"
zeroize_derive = "1.1.0"
# bcrypt
blowfish = { version = "0.8.0", features = ["bcrypt"] }
# UX (for password entry and notifications)
gam = {path="../gam"}
locales = {path = "../../locales"}
modals = {path="../modals"}
[target.'cfg(not(any(windows,unix)))'.dependencies]
utralib = { path = "../../utralib"}
[target.'cfg(any(windows,unix))'.dependencies]
rand = "0.7.3"
rand_chacha = "0.3.1"
[features]
# when selected, physical disk addresses are set to 64 bits, otherwise, they are 32 bits.
# 32 bit addressing is recommended for Precursor, as its disk is only 128MiB and it has limited RAM for bookkeeping.
u64_pa = []
# selecting mbbb employs a "make before break" update on the page table. This minimizes risk of corruption of
# the page table when being updated in the case of a power loss, in exchange for more than doubling the time it
# takes to update the page table.
mbbb = []
# selecting deterministic makes the allocation and page replacement algorithms deterministic. normally we don't want
# this but it's helpful for debugging.
deterministic = []
# this flag adds CI tests to the build
ci = []
# this feature is for text-to-speech support
tts = []
# support migration type 1, from version 00.00.01.01 -> 00.00.02.01
migration1 = []
# hazardous debug flag decorates any debug paths that might accidentally leak key material
hazardous-debug = []
default = ["mbbb", "migration1", "hazardous-debug"]