Security Engineering

An updater downloads a package and its SHA-256 hash from the same vendor mirror. An attacker who compromises the mirror could replace both files. What change lets the updater detect a swapped package?

Show the answer

Correct answerA. Verify a digital signature against the publisher's pinned public key

AWhy this is right: The attacker cannot forge a signature without the publisher's private key, so a swapped package fails verification.

BWhy not this: A key stored on the compromised mirror is available to the attacker, and encryption does not prove who published the package.

CWhy not this: TLS protects the download in transit but not the files stored on a compromised mirror.

DWhy not this: A longer hash is just as easy for an attacker with mirror access to recompute and replace.

A signature can only be produced with the publisher's private key, which the mirror does not hold, so a replaced package fails verification against the pinned public key. A hash on the same mirror can simply be regenerated by the attacker, whatever its length.