Skip to content

Qubes 4.3 backup restore randomly fails to decrypt different chunks with "scrypt: Passphrase is incorrect" #11106

Description

@guillaumedebruyne

Qubes OS release

Qubes OS 4.3

Relevant package versions:

qubes-core-dom0-4.3.51-1.fc41.noarch
qubes-core-admin-client-4.3.34-1.fc41.noarch
qubes-core-dom0-linux-4.3.22-1.fc41.x86_64
scrypt-1.3.3-1.fc41.x86_64
kernel: 6.18.46-1.qubes.fc41.x86_64
CPU: AMD Ryzen 5 1400

The backup uses format version 4:

version=4
encrypted=True
compressed=True
compression-filter=gzip
hmac-algorithm=scrypt

Brief summary

An encrypted Qubes backup is successfully created, but verification/restoration intermittently fails with:

scrypt: Passphrase is incorrect

The important point is that the failing encrypted chunk changes between verification attempts on the same backup archive using the same passphrase.

Observed failures have included:

qubes.xml.000.enc
vm17/root.img.000.enc
vm17/root.img.004.enc
vm17/root.img.006.enc

A chunk reported as failing by qvm-backup-restore can subsequently be successfully decrypted manually in dom0.

I have not identified the root cause.

Steps to reproduce

  1. Create an encrypted Qubes backup stored in a dedicated AppVM (backup).

  2. Verify the backup using either the GUI integrity verification or:

qvm-backup-restore -v --verify-only \
  --passphrase-file /tmp/qubes-backup-pass \
  --dest-vm backup \
  backup-test/qubes-backup-2026-09-03T092223
  1. The verification fails with, for example:
Getting new file: vm17/root.img.000.enc
...
qvm-backup-restore: error: failed to decrypt .../vm17/root.img.000.enc:
b'scrypt: Passphrase is incorrect\n'
  1. Run the same verification again, with exactly the same archive and passphrase.

The failure can occur on a different encrypted chunk. Previous runs failed on qubes.xml.000.enc, vm17/root.img.004.enc, and vm17/root.img.006.enc.

A simple ASCII-only passphrase was also tested to rule out special-character or encoding issues.

Expected behavior

A successfully created backup should consistently pass --verify-only when using the correct passphrase.

Actual behavior

Verification intermittently fails on apparently varying encrypted chunks with:

scrypt: Passphrase is incorrect

The failure does not appear to be deterministic corruption of one specific chunk.

Additional information

I performed several tests to isolate the problem.

Archive integrity

qubes.xml.000.enc was independently extracted three times from the same backup. All three copies had exactly the same SHA-256:

10fa88a9e5f32d710b3659e6bc47c7a5cf74da64a2583b79e52b2f83ece556e9

The chunk was then transferred from the backup AppVM to dom0 using qvm-run --pass-io. Its SHA-256 remained identical.

The same qubes.xml.000.enc was successfully decrypted several times directly in dom0 using the Qubes v4-derived scrypt passphrase, producing identical decrypted outputs.

Testing a chunk immediately after qvm-backup-restore rejected it

One verification run specifically failed on:

vm17/root.img.000.enc

I manually extracted that exact chunk from the same backup.

Size:

101M

SHA-256:

5944fca8298d5bb3408f22574efa7afa18174899a23f4096318042b08c49daba

After transferring it to dom0, the SHA-256 remained identical.

The exact chunk that qvm-backup-restore had just rejected was then successfully decrypted manually in dom0 with:

scrypt dec -f /tmp/root000.enc /tmp/root000.dec

using the appropriate Qubes v4-derived passphrase.

Testing Qubes' own launch_scrypt()

I also tested the function used by Qubes directly:

from qubesadmin.backup.restore import launch_scrypt

p = launch_scrypt(
    'dec',
    '/tmp/root000.enc',
    '/tmp/root-test.dec',
    '<Qubes-v4-derived-passphrase>'
)

p.communicate()
p.returncode

Result:

(None, b'')
0

Therefore launch_scrypt() successfully decrypted the exact encrypted chunk that had failed during the complete qvm-backup-restore verification.

Other tests

A direct 256 MiB scrypt enc / scrypt dec round-trip in dom0 succeeded and cmp confirmed identical data.

Memtest86+ was run for approximately 13 hours:

4/4 passes
0 errors
PASS

The problem was also reproduced with the backup stored in the backup AppVM private volume on the system NVMe, rather than on the separate SATA backup disk.

So far, the individually tested path appears stable:

backup archive
 -> tar extraction
 -> transfer from backup AppVM to dom0
 -> scrypt
 -> decrypted data

The failure has only been reproduced when using the complete Qubes backup restore/verification pipeline.

I have not determined whether the issue is in the retrieval/unpacking pipeline, synchronization between its components, or elsewhere.

I can perform additional diagnostic tests or provide additional logs if needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: coreThis issue pertains to a Qubes core component.P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.affects-4.3This issue affects Qubes OS 4.3.needs diagnosisRequires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions