-
Notifications
You must be signed in to change notification settings - Fork 370
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
featture request: blackbox_edit shouldn't re-encrypt a file if no changes were made #326
Comments
I agree that it would be better if it didn't re-encrypt when the file hasn't changed. Sadly gpg doesn't maintain timestamps in a way that makes this easy. When A way to make it work would be to take the hash of the file when decrypted, or decrypt to a temporary file to see if the file has changed right before deciding if it changed. However one would also have to take into account if files-admins.txt has changed. Doing that in Bash seems difficult but the new Go version (which needs beta tests) should make that easier. Tom |
Pardon my ignorance, but do you mean
Having only superficially read the bash code, my naive approach would to take the decrypting functions such as blackbox/bin/_blackbox_common.sh Line 267 in a413aff
and blackbox/bin/_blackbox_common.sh Line 289 in a413aff
And change it to something like (some options omitted for clarity): This removes the This approach ignores your comment on files-admin.txt (sorry) because I couldn't find info on it. |
Ah, yes, I did mean Sounds like you have some really smart ideas about how to fix this in Bash. If you'd like to give it a try, I'd love to get a PR! |
Does this project assume GNU coreutils is installed? (Needed for tee and sha1sum) Any preference among md5sum, sha1sum, ... ? |
coreutils: Yes, assume that hash algorithm: I don't have a preference as long as it is supported on macOS, Linux, FreeBSD and Windows. Some background:
Let me know how I can help! |
Sorry if this has veen discussed before, but I think if a file,
testfile.gpg
, is opened withblackbox_edit
but no changes are made to the file, then the originaltestfile.gpg
should be left alone rather than be overwritten by a newly encrypted version of the same file. Perhaps checking modification time or checksum the contents of a file when decrypting, then check it against the decrypted file when deciding to re-encrypt?The text was updated successfully, but these errors were encountered: