Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] File encryption #49

Closed
nicolaspernoud opened this issue Jun 17, 2022 · 3 comments
Closed

[Feature request] File encryption #49

nicolaspernoud opened this issue Jun 17, 2022 · 3 comments

Comments

@nicolaspernoud
Copy link

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.

@sigoden
Copy link
Owner

sigoden commented Jun 17, 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.

@nicolaspernoud
Copy link
Author

Ok, I understand. Thanks for your answer.

@nicolaspernoud
Copy link
Author

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants