LFCS · Question #405
You have downloaded a file named file.tgz along with a signature file named file.tgz.asc. Which commands can be used to verify that file.tgz has not been tampered with since the file creator created…
The correct answer is A. gpg verify file.tgz.asc file.tgz C. gpg verify file.tgz.asc E. gpgv file.tgz.asc. To verify a detached GPG signature (.asc) against its corresponding data file (.tgz), you can use gpg verify with both files, gpg verify with just the signature file (if named conventionally), or the gpgv utility with just the signature file.
Question
Options
- Agpg verify file.tgz.asc file.tgz
- Bgpg verify file.tgz
- Cgpg verify file.tgz.asc
- Dgpgv verify file.tgz.asc
- Egpgv file.tgz.asc
How the community answered
(24 responses)- A75% (18)
- B17% (4)
- D8% (2)
Why each option
To verify a detached GPG signature (`.asc`) against its corresponding data file (`.tgz`), you can use `gpg verify` with both files, `gpg verify` with just the signature file (if named conventionally), or the `gpgv` utility with just the signature file.
The `gpg --verify <signature_file> <signed_file>` command explicitly instructs GPG to verify the integrity of the signed data file using the provided detached signature file.
`gpg verify file.tgz` is incorrect because it expects the file itself to contain an inline signature, not a detached one, and would not automatically search for `file.tgz.asc`.
When a signature file (e.g., `file.tgz.asc`) has a conventional name corresponding to its data file (e.g., `file.tgz`), `gpg --verify file.tgz.asc` can automatically locate and verify the data file against the signature.
`gpgv verify file.tgz.asc` is syntactically incorrect; `gpgv` itself implies verification, so the `verify` subcommand is redundant and not part of the `gpgv` syntax.
The `gpgv` command is a lightweight utility optimized for signature verification, and when given a detached signature file (e.g., `file.tgz.asc`), it will implicitly look for and verify the integrity of the corresponding data file (`file.tgz`).
Concept tested: GPG detached signature verification
Source: https://gnupg.org/documentation/manuals/gnupg/Verify-signatures.html
Topics
Community Discussion
No community discussion yet for this question.