diff --git a/src/duplicacy_snapshotmanager.go b/src/duplicacy_snapshotmanager.go index 287bc32..a7f0816 100644 --- a/src/duplicacy_snapshotmanager.go +++ b/src/duplicacy_snapshotmanager.go @@ -2292,6 +2292,10 @@ func (manager *SnapshotManager) DownloadFile(path string, derivationKey string) return nil } + if len(derivationKey) > 64 { + derivationKey = derivationKey[len(derivationKey) - 64:] + } + err = manager.fileChunk.Decrypt(manager.config.FileKey, derivationKey) if err != nil { LOG_ERROR("DOWNLOAD_DECRYPT", "Failed to decrypt the file %s: %v", path, err) @@ -2322,6 +2326,10 @@ func (manager *SnapshotManager) UploadFile(path string, derivationKey string, co } } + if len(derivationKey) > 64 { + derivationKey = derivationKey[len(derivationKey) - 64:] + } + err := manager.fileChunk.Encrypt(manager.config.FileKey, derivationKey) if err != nil { LOG_ERROR("UPLOAD_File", "Failed to encrypt the file %s: %v", path, err)