Fix encryption to preserve original file extension

Encryption now appends .enc to the full filename instead of replacing
the extension. This preserves the file format through the encrypt/decrypt
round-trip (e.g., image.png → image.png.enc → image.png).
This commit is contained in:
MachinePainting
2026-02-22 21:13:57 -08:00
parent 2379b0e03d
commit 7ce5a0a5fb
+1 -2
View File
@@ -104,8 +104,7 @@ class FileEncryptHandler(FileSystemEventHandler):
file_data = f.read()
encrypted_data = fernet.encrypt(file_data)
base_name = os.path.splitext(file_path)[0]
enc_path = base_name + '.enc'
enc_path = file_path + '.enc'
with open(enc_path, 'wb') as f:
f.write(encrypted_data)
logger.info(f"[DriveSend] Created encrypted file: {enc_path}")