Windows/SHA256

From Omnia
Jump to navigation Jump to search

certutil

certutil -hashfile [FILE] SHA256
certutil -hashfile [FILE] sha256
certutil -hashfile [FILE] SHA256 > file.certutil  # does not appear to be designed for compare other than visually

Example:

C:\test> certutil -hashfile SOMEFILE sha256
SHA256 hash of SOMEFILE:
2f4a20cca5fce6f872bcfc17828fe7cc4f398ce69de25f5798b0d3ffbxxxxxxx
CertUtil: -hashfile command completed successfully.

get-filehash

Get-FileHash -Algorithm SHA256 [FILE]
get-filehash -algorithm sha256 [FILE]
get-filehash [FILE]  # default appears to be sha256
Get-FileHash -Algorithm SHA256 [FILE] > file.getfilehash  # does not appear to be designed for compare other than visually

Example:

C:\test> Get-FileHash -Algorithm SHA256 SOMEFILE

Algorithm       Hash                                                                   Path
---------       ----                                                                   ----
SHA256          2F4A20CCA5FCE6F872BCFC17828FE7CC4F398CE69DE25F5798B0D3FFBxxxxxxx       C:\test\SOMEFILE

Compare Hash

None of the above seem to be comparable programatically by design?