WIP: keyfork-shard: limit size of encrypted payload, can fit at max a 256 bit shard #26
Loading…
Reference in New Issue
No description provided.
Delete Branch "ryan/optimize-hunk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change is backwards-incompatible and will require a version bump, but knocks 9 words off of the remote hunk. That space can be reclaimed by moving the nonce from the combiner payload to the operator payload.
Side note: combiner payload does not have a hunk version. That should be remedied in the same change. It will take four bytes.
keyfork-shard: limit size of encrypted payload, can fit at max a 256 bit shardto WIP: keyfork-shard: limit size of encrypted payload, can fit at max a 256 bit shardWaiting on confirmation of moving nonce.
note: nonce is sent over an assumed authenticated channel, tampering with the nonce is not considered an option, and if someone can send an invalid nonce over the authenticated channel, they can also just initialize their own decrypt request. nonce tampering only becomes an issue with authenticated requests (see: #23, #24). once that's done, authenticated payloads will look like the following:
1-byte version number: 0x01
1-byte is-authenticated flag: 0x01
2-byte padding
32-byte ephemeral public key
8-byte timestamp:
std::time::SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs()
64-byte signature(ephemeral public key || timestamp)
Total payload is 81 words and should be encoded all at once.
Unauthenticated payloads will look like the following:
1-byte version number: 0x01
1-byte is-authenticated flag: 0x00
2-byte padding
32-byte ephemeral public key
Total payload is 27 words and should be encoded all at once.
Payload from the client will be:
32-byte public key
12-byte nonce
52-byte payload
Total payload is 72 words and should be encoded all at once.
The size decrease of the payload is now negated by the nonce, but in exchange authenticated payloads become possible and unauthenticated payloads are reduced to 27 words instead of 33 words.
Authentication of authenticated requests is not exclusive to enclaves and does not use enclave attestation. Enclave attestation can be added atop the existing framework to attest the public key used to verify the request. This assumes that, at some point, an authorized key is to be added to the shard payload file, likely as its own encrypted message.
Once this is implemented, keyfork-shard should also have some kind of
repair-shardfile
, which upgrades a shardfile from one version to the next. TODO: embed version in shardfile.no longer applicable, other PRs managed this better
Pull request closed