Syn*_*ech 6 hashing directory-listing
偶尔,我会使用如下命令对我的驱动器进行完整快照。
> for %i in (%drives_hd%) do @dir %i:\/s/a/o>>File_List.txt
Run Code Online (Sandbox Code Playgroud)
这提供了我系统上所有文件的详细信息(路径、文件名、日期和大小),非常适合在不占用太多空间的情况下保持文件标签(约 50MB 约 500,000 个文件)。问题是它不包含哈希值。
显然有文件散列工具,但它们没有提供其他详细信息,并且没有实用的方法来单独进行散列并将其/它们与目录列表结合起来。
我正在寻找一种工具,它可以创建一个具有完整详细信息的文本文件,例如dir命令,但还包括文件哈希(至少是 CRC(32)、MD5 和 SHA1)。它也应该写得很好,以便无论您要求它执行多少个散列,它只读取每个文件一次(即,不要为每个散列类型读取整个文件一次)。
我更喜欢 CLI 程序,但 GUI 程序也可以,只要它可以从脚本运行。
我什至对 Linux 工具的(Windows 端口)持开放态度。
我在谷歌上找不到任何东西(虽然我很惊讶这样一个有用的工具并不常见),并且我已经考虑过自己编写这样一个工具,但我希望已经存在一些东西。
默认dir输出:
Volume in drive C is C-WINDOWSXP
Volume Serial Number is 1234-5678
Directory of C:\
2007.07.05 04:05p <DIR> Documents and Settings
2011.05.04 07:38p <DIR> Program Files
2010.04.02 11:35p <DIR> WINDOWS
2011.10.09 10:45p 454 BOOT.INI
2002.08.28 10:08p 47,580 NTDETECT.COM
2002.08.29 02:05a 233,632 NTLDR
3 File(s) 281,666 bytes
Directory of C:\Documents and Settings
2003.11.12 03:08p <DIR> .
2003.11.12 03:08p <DIR> ..
2007.07.05 10:36p <DIR> Administrator
2007.07.05 04:21p <DIR> All Users
0 File(s) 0 bytes
Directory of C:\Documents and Settings\All Users
2003.11.12 03:08p <DIR> .
2003.11.12 03:08p <DIR> ..
2007.07.05 04:23p <DIR> Application Data
2011.06.23 03:23p <DIR> Documents
2011.01.09 12:56p 262,144 ntuser.dat
1 File(s) 262,144 bytes
...
Run Code Online (Sandbox Code Playgroud)
期望的输出:
Volume in drive C is C-WINDOWSXP
Volume Serial Number is 1234-5678
Directory of C:\
2007.07.05 04:05p <DIR> Documents and Settings
2011.05.04 07:38p <DIR> Program Files
2010.04.02 11:35p <DIR> WINDOWS
2011.10.09 10:45p 454 BOOT.INI d1183b26 fad47d7d255e1189dbef3003fba96868 39c9bbe3edad58a5bd091ea1db8f9b6cf03f9566
2002.08.28 10:08p 47,580 NTDETECT.COM a709deed 28a3ac957be5d239a3dd4f3d4cdbf3b8 f5625a158d92478c814df3b33a9ad5fcd5f8a956
2002.08.29 02:05a 233,632 NTLDR 0d7e47bd 9896e483e211b8cd1fa7bb32572f02ec c57426135d0419985681a674149c88e652c8ec63
3 File(s) 281,666 bytes
3 Dir(s)
Directory of C:\Documents and Settings
2003.11.12 03:08p <DIR> .
2003.11.12 03:08p <DIR> ..
2007.07.05 10:36p <DIR> Administrator
2007.07.05 04:21p <DIR> All Users
0 File(s) 0 bytes
2 Dir(s)
Directory of C:\Documents and Settings\All Users
2003.11.12 03:08p <DIR> .
2003.11.12 03:08p <DIR> ..
2007.07.05 04:23p <DIR> Application Data
2011.06.23 03:23p <DIR> Documents
2011.01.09 12:56p 262,144 ntuser.dat fc3d370a b3ea06755f614e2c18fc1de875b60126 8264549330d9dbef494264227be9fadffe653556
1 File(s) 262,144 bytes
2 Dir(s)
Run Code Online (Sandbox Code Playgroud)
温哈舍尔:
WinHasher 是一个免费的开源加密哈希或摘要生成器,使用 Microsoft 的 .NET 2.0 Framework 用 C# 编写。它可用于验证文件下载完整性、比较两个或多个文件的修改情况,并在某种程度上生成强而独特的密码。
cmdhashgen 是一个命令行实用程序,可用于为给定的字符串或文件生成各种哈希值。
支持的哈希值包括 CRC32、MD5、SHA-1、SHA-256、SHA-384 和 SHA-512。
WinHasher 具有包括“Hash”在内的命令行实用程序,可以将其绑定到批处理文件或脚本中。看起来这两个包中更稳定。
Usage: hash [-md5|-sha1|-sha256|-sha384|-sha512|-ripemd160|-whirlpool|
-tiger] [-base64|-hexcaps|-bubbab] filename1 [filename2 ...]
WinHasher is a command-line cryptographic hash generator for files. It
runs in one of two modes: single file hashing and multi-file comparison.
In single file mode, WinHasher computes the cryptographic hash of the
given file and prints it to the screen. With no command-line switches,
it computes the SHA-1 hash and displays it in hexadecimal format. Various
switches allow you to change to other hashing algorithms, such as MD5,
the SHA family, RIPEMD-160, Whirlpool, and Tiger. The "-base64" switch
causes WinHasher to output hashes in MIME Base64 (RFC 2045) format rather
than hexadecimal, "-hexcaps" outputs hexadecimal with all capital letters,
and "-bubbab" uses Bubble Babble encoding.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3994 次 |
| 最近记录: |