Which Linux command can be used to generate a hash?

Advance your skills with our Digital Forensics Test. Explore detailed questions, explanations, and suggestions. Ace your exam!

Multiple Choice

Which Linux command can be used to generate a hash?

Explanation:
Generating a hash means producing a fixed-length fingerprint of data using a hash algorithm. In Linux, md5sum is the standard utility to compute an MD5 hash of a file or from standard input. It outputs the hash value followed by the file name, which you can compare with a known digest to verify integrity. For example, running md5sum on a file will give you a 32-character hex string that represents its MD5 hash. You can verify against a stored digest by piping or using md5sum -c with a digest file. The other options aren’t standard commands for generating hashes: there isn’t a generic hashsum command, and checksum isn’t a typical tool name. If you need a different algorithm, there are dedicated tools like sha1sum, sha256sum, and so on, with sha256sum becoming a common choice for stronger hashes due to MD5’s weaknesses.

Generating a hash means producing a fixed-length fingerprint of data using a hash algorithm. In Linux, md5sum is the standard utility to compute an MD5 hash of a file or from standard input. It outputs the hash value followed by the file name, which you can compare with a known digest to verify integrity. For example, running md5sum on a file will give you a 32-character hex string that represents its MD5 hash. You can verify against a stored digest by piping or using md5sum -c with a digest file.

The other options aren’t standard commands for generating hashes: there isn’t a generic hashsum command, and checksum isn’t a typical tool name. If you need a different algorithm, there are dedicated tools like sha1sum, sha256sum, and so on, with sha256sum becoming a common choice for stronger hashes due to MD5’s weaknesses.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy