Which Windows command computes the SHA-256 hash of a file?

Enhance your cyber defense skills with the Security Blue Team Level 1 Test. Prepare with flashcards, multiple choice questions, and detailed explanations to ace your exam!

Multiple Choice

Which Windows command computes the SHA-256 hash of a file?

Explanation:
To verify a file’s integrity on Windows, you compute a SHA-256 hash using the built-in PowerShell tool Get-FileHash. This cmdlet is designed specifically for generating file hashes, and you can specify the algorithm, including SHA256, to produce the correct hash value for comparison. Two of the options point to Linux-style utilities (sha256sum and md5sum), which aren’t part of Windows by default. One option uses a Windows command but requests MD5 instead of SHA-256, which would give you a different hash. The remaining option is Get-FileHash with SHA256, which is the standard Windows approach for this task. In PowerShell, you’d typically run something like Get-FileHash -Algorithm SHA256 -Path "C:\path\to\file" to obtain the SHA-256 hash for verification. This makes it the correct choice because it uses Windows’ native hashing tool and specifies the SHA-256 algorithm.

To verify a file’s integrity on Windows, you compute a SHA-256 hash using the built-in PowerShell tool Get-FileHash. This cmdlet is designed specifically for generating file hashes, and you can specify the algorithm, including SHA256, to produce the correct hash value for comparison.

Two of the options point to Linux-style utilities (sha256sum and md5sum), which aren’t part of Windows by default. One option uses a Windows command but requests MD5 instead of SHA-256, which would give you a different hash. The remaining option is Get-FileHash with SHA256, which is the standard Windows approach for this task.

In PowerShell, you’d typically run something like Get-FileHash -Algorithm SHA256 -Path "C:\path\to\file" to obtain the SHA-256 hash for verification. This makes it the correct choice because it uses Windows’ native hashing tool and specifies the SHA-256 algorithm.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy