[GH-ISSUE #49] [Feature request] File encryption #23

Closed
opened 2026-04-08 16:49:51 +03:00 by zhus · 3 comments
Owner

Originally created by @nicolaspernoud on GitHub (Jun 17, 2022).
Original GitHub issue: https://github.com/sigoden/dufs/issues/49

Hello,
Thanks for this amazing work.
It would be nice to have an option to encrypt files in place providing a key as argument.
That should be probably achievable with something like described here : https://kerkour.com/rust-file-encryption, apart from the tricky part of working out the real file size from the encrypted file size... and to store a generated per file nonce as an encrypted file header, so that the nonce is not the same for each file, but recoverable from the file itself...
Best regards.

Originally created by @nicolaspernoud on GitHub (Jun 17, 2022). Original GitHub issue: https://github.com/sigoden/dufs/issues/49 Hello, Thanks for this amazing work. It would be nice to have an option to encrypt files in place providing a key as argument. That should be probably achievable with something like described here : https://kerkour.com/rust-file-encryption, apart from the tricky part of working out the real file size from the encrypted file size... and to store a generated per file nonce as an encrypted file header, so that the nonce is not the same for each file, but recoverable from the file itself... Best regards.
zhus closed this issue 2026-04-08 16:49:51 +03:00
Author
Owner

@sigoden commented on GitHub (Jun 18, 2022):

Thanks for your suggestion.

File encryption is too niche and too professional for a simple file server.

Object storage like s3/minio is good at this.

<!-- gh-comment-id:1159304202 --> @sigoden commented on GitHub (Jun 18, 2022): Thanks for your suggestion. File encryption is too niche and too professional for a simple file server. Object storage like s3/minio is good at this.
Author
Owner

@nicolaspernoud commented on GitHub (Jun 18, 2022):

Ok, I understand. Thanks for your answer.

<!-- gh-comment-id:1159388657 --> @nicolaspernoud commented on GitHub (Jun 18, 2022): Ok, I understand. Thanks for your answer.
Author
Owner

@nicolaspernoud commented on GitHub (Jun 21, 2022):

In case you could be interested anyway, I made a quick proof of concept here : https://github.com/nicolaspernoud/dufs/tree/encryption .
The key is all zeros (but easy to pass as arguments), there is lots of ugly unwraps, the non encrypted case is not catered for, the range header as well ... but the nonce is properly randomized and stored at the beginning of the file, and the decrypted file size is properly calculated...

<!-- gh-comment-id:1161987784 --> @nicolaspernoud commented on GitHub (Jun 21, 2022): In case you could be interested anyway, I made a quick proof of concept here : https://github.com/nicolaspernoud/dufs/tree/encryption . The key is all zeros (but easy to pass as arguments), there is lots of ugly unwraps, the non encrypted case is not catered for, the range header as well ... but the nonce is properly randomized and stored at the beginning of the file, and the decrypted file size is properly calculated...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#23