After a recent security review, you are asked to improve the integrity check that accompanies your nightly backups.
The existing script:
tar czf /backups/nightly.tar.gz /data
sha256sum /backups/nightly.tar.gz > /backups/nightly.tar.gz.sha256
and both files are copied to a read-only NFS share that is visible to everyone on the operations network. Management wants to be sure that an attacker who can read the share cannot replace the archive with malicious data yet still produce a matching checksum. SHA-256 must remain the underlying algorithm because downstream systems depend on it.
Which change to the script BEST satisfies this requirement?
Replace SHA-256 with a faster unsalted MD5 checksum to simplify manual verification.
Truncate the SHA-256 digest to 128 bits before saving it to make brute-force collisions more difficult.
Keep SHA-256 but encode the digest in Base64 rather than hexadecimal before saving it.
Use a command that generates an HMAC-SHA-256 value with a secret key known only to the backup and verification processes, and store that value instead of the plain checksum.
Replacing the plain SHA-256 checksum with an HMAC constructed from SHA-256 and a secret key thwarts an attacker who only has read access to the share. Because the key is stored only on the backup host and the verification host, an adversary cannot recompute a valid digest for tampered data. Simply re-encoding the same digest, shortening it, or switching to MD5 does not add authenticity and, in the latter two cases, lowers security.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is an HMAC and how does it differ from a plain checksum?
Open an interactive chat with Bash
Why is storing the HMAC secret key securely important?
Open an interactive chat with Bash
Why does the solution require SHA-256 specifically, and not alternatives like MD5?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access