Encryption in the Global Data Plane
Eric Allman, Swarm Lab, U.C. Berkeley
This is a working document, more musing and request for comment than
tutorial. Nothing herein is definitive.
Issues
Need reasonable efficiency. Implies not doing public key operations on
a per-record basis, which in turn means using symmetric keys across multiple
records.
Need to handle revocation.
How to retroactively grant permission? This is the flip side of
revocation: you want a new reader to be able to read data already
written. Simple if you share the secret keys around, harder if you do
not.
Two major options: might have key pairs associated with readers, and the
writer grants permission to specific readers, versus sharing the secret key
with all readers. Either way there are key management issues, but they
are different. This discussion attempts to discuss both options.
Operations
Assumption: most of the Writing and Reading operations are amenable to
caching. These algorithm overviews do not include caching to keep
things simple.
Nomenclature:
- K = symmetric key
- P = public key
- S = secret key
- EK(m), DK(m) = encrypt or decrypt m using key K
(also applies to P and S; EK ≡ DK for
symmetric keys K)
- L = a log
- GL = corresponding generational log (to store key
information)
- GL:g = information corresponding to generation g
Creating a Log L
- Create a (symmetric) key K
- Create a key pair (Sr1, Pr1) [only if sharing
secret key]
- Encrypt K with Pi, i ∈ { self, r1, r2
...}, self is your own key, and ri are readers [only one if
sharing secret key]
- Create Generational Log GL unique to this log L
- Write EPi(K) ∀i to GL (this is
generation GL:1)
Writing
- Writer reads GL:g from GL, where GL:g
is the last entry in GL
- Use Sself to decrypt K from GL:g
- Use K to encrypt data
- Prepend generation number g (unencrypted) before writing encrypted
data EK(m)
Reading (Normal Case)
- Reader reads datum X and extracts generation number g
- Look up GL:g from GL
- See if we have a secret key SrN that will decrypt one of
the encrypted copies of K; if not, fail (but see Problem Case below)
- Decrypt remainder of datum with K
Revocation
Revocation looks very similar to creation.
- Create new symmetric key K′
- Create new key pair (S′r1, P′r1)
[only if sharing secret key]
- Encrypt K′ with Pself, Pr1, Pr2...
(need not be the same set of readers)
- Encrypt old key K with new key K′
- Write encrypted K and EPi(K) ∀i to GL
(this creates a new generation)
- Start using K′ as K
Reading (Problem Case)
This could be because you have no access, or you do but you have to read
backwards through generations to find the K you need for the record.
- Reader reads datum and extracts g from datum, reads GL,g
from GL, but does not have a valid secret key to decrypt it
- Read GL,n from GL where n is the most recent
generation
- If no access to that generation, give up (means your access has been
denied)
- Use that access to decrypt K
- For k ∈ {n–1, n–2, ... i}, use Kk+1 to
decrypt Kk
- Stop when you find a valid S
Security Analysis/Discussion/Questions
Once a reader has access to any point in the log, they have access to all
points prior. This could be mitigated by not including EK′(K)
in new GL records, but then granting backward access would be
hard.
If each reader had its own key pair, then this looks like an ACL.
"Reader" here could mean "application", "user", "administrative domain",
or something else. Alternatively, each log could have its own key
pair, which would mean that somehow that secret key SL has to
be distributed to all possible readers, and revocation becomes a matter of
changing SL as well as K. The encryption key pair should
probably not be the same one used for signing.
This description ignores the step of signing the updates to GL.
Clearly GL will need a key pair of its own, and it's not clear
if that might be shared with the original log L.
If secret keys are are being created per log and distributed around, they
need to be encrypted themselves; at some point there has to be a
decryption key not held on disk in encrypted form or the game is
over. Q: could TPM help us here?