Skip to content

feat: add optional client-side encryption for buckets#97

Open
jedisct1 wants to merge 1 commit intohuggingface:mainfrom
jedisct1:encryption
Open

feat: add optional client-side encryption for buckets#97
jedisct1 wants to merge 1 commit intohuggingface:mainfrom
jedisct1:encryption

Conversation

@jedisct1
Copy link
Copy Markdown
Contributor

@jedisct1 jedisct1 commented Apr 2, 2026

This PR adds optional client-side encryption.

Client-side encryption feels like a natural fit for buckets, where deduplication is likely less relevant than content in repos.

To keep the change low-risk, the implementation is feature-gated behind encrypt and is designed to minimize impact on the existing non-encrypted path.

The scope is kept narrow. Features like password-based key derivation, key rotation, and other usability improvements could be added incrementally later if they seem worthwhile.

Encryption is handled by the aegis crate, which already include a complete API for encrypted filesystems.

I realize this introduces functionality that has not been discussed previously, so I completely understand if it does not feel like the right fit for the project at this time.

I still wanted to share it for review because I think it could be valuable for some users. If it makes more sense to keep this as a separate fork, I am also happy to maintain it that way.

@jedisct1 jedisct1 changed the title Add optional client-side encryption for buckets feat: add optional client-side encryption for buckets Apr 2, 2026
Encrypt file contents before upload and decrypt transparently on read,
using the aegis crate's RAF layer.

Gated behind --features encrypt and activated by --encryption-key-file.

Supports all six AEGIS variants (128L, 128X2, 128X4, 256, 256X2, 256X4)
via --encryption-algorithm, defaulting to aegis-128x2.

Per-file algorithm is recorded in content_type metadata so reads
always use the correct variant.

Rewrites of existing encrypted files preserve the original algorithm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant