Repository navigation
Native encryption: age, one content layout, and seekable packs - #218
Draft
mbertschler wants to merge 5 commits into
Draft
mbertschler wants to merge 5 commits into
mbertschler wants to merge 5 commits into
Conversation
Review of the native crypt proposal:
- Artifacts are encrypted to a random data identity kept in
.squirrel-keys, which the agent identity and the recovery kit open. A
rekey rewrites .squirrel-keys and starts a new generation; no artifact
is rewritten, and every file opens with the new keys. The write-time
check now covers every artifact's only stanza, and the former open
question on rewrapping is settled.
- .squirrel-keys is one ciphertext copied to the root, every volume
directory and the local store, so snapshots carry it without
disclosing anything.
- Crypt is allowed only on local and sftp until the S3 transport lands;
rclone moves no ciphertext.
- cloudbox is verified by its server's sha256sum at landing and on every
verify pass; presence+size never gates offload.
- No secret sits in the config file: every secret field takes
{ file = ... } or { env = ... }, and keygen writes the agent identity
to a private key file outside every volume.
- A destination's first drill gates its offload credit, and a rekey to
a new kit resets it; ux-principles records the hold.
- The snapshot path leak on plaintext destinations is stated and
tracked in #219.
A destination earns offload credit only while its current kit has been drilled within recovery_drill_every, not just once. The reminder starts at three quarters of the cadence, so a timely drill never stalls an offload; durability pulls carry the last drill time and cadence, so relayed credit lapses on time. Pushes, verify and restore never wait.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposes step 3 of the rclone replacement in
design/native-crypt.md: squirrel encrypts every artifact itself in the age format, rclone's crypt overlay goes away, and packs become seekable. It follows #216 and #217. The S3 transport comes afterwards, on its own branch.This pull request holds the design only. Implementation follows on this branch, in the sessions below.
The design in short
pack_threshold = 0still stores every file as an object.cryptis accepted on packed destinations and refused on mirrors: an encrypted mirror needs a tool to read any file, yet discloses every path, size and modification time.localandsftp, written natively. Encrypted s3, b2 and gcs destinations are refused until the S3 transport lands; rclone never handles an encrypted destination.mlkem768x25519, age v1.3+). Recovery without squirrel needs the stockagecommand, zstd, tar and a BLAKE3 tool..squirrel-keys, which holds the destination's random data identity and naming key. Every other file is encrypted to the data identity.destination rekeyre-encrypts.squirrel-keysto the new keys and starts a new data generation; no artifact is rewritten, and every file opens with the new keys..squirrel-keysis one ciphertext with many copies: the root, every volume directory, and the local store, so every index snapshot carries it without disclosing anything.sha256sumat landing and on every verify pass;presence+sizenever gates offload.{ file = … }or{ env = … }; a key file must be private and outside every volume.keygenwrites the agent identity to such a file.localandsftp. Restoring one file reads one frame instead of the whole pack.ux-principles.md.Also amended here:
native-mirror.md(its crypt question is decided),ux-principles.md§1 (the drill's exception and its hold on offload credit), anddesign/README.md.Related: #219 (ride-along index snapshots disclose every volume's paths on plaintext destinations), stated in the design and fixed separately.
Open questions
None. Rewrapping artifacts after a rekey is no longer needed.
Sessions
Working rules as on #217: commit small and push often, never rebase or force-push, keep
go vet ./...,go test ./...andgolangci-lint rungreen on every push, amend the design in the same commit when the code proves it wrong, tick the box and leave a short note when a session finishes, and never mark this pull request ready or merge it..squirrel-keysand the native encryption layer. Retiring the content-addressed layout first, then thefileandenvsecret forms, thecryptblock,keygen,.squirrel-keysand its copies, recipient pinning, the encryption layer with object padding intransportArtifacts, and the evidence rows forlocalandsftp. The shared content-addressed and packed test fixtures become packed fixtures on the native transports first.--identity,rekeywith its generations, and the recovery procedure in formats.md.GetRangeonlocalandsftp, and the restore strategy.verify --recovery-kit, its reminder and its hold on offload credit, the tampering suite, the docs framing review, reference-setup.md, the testbed walk, and the benchmark.