rehash.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <!--------------------------------------------------------------------------->
  2. <!-- INTRODUCTION
  3. The Code Project article submission template (HTML version)
  4. Using this template will help us post your article sooner. To use, just
  5. follow the 3 easy steps below:
  6. 1. Fill in the article description details
  7. 2. Add links to your images and downloads
  8. 3. Include the main article text
  9. That's all there is to it! All formatting will be done by our submission
  10. scripts and style sheets.
  11. -->
  12. <!--------------------------------------------------------------------------->
  13. <!-- IGNORE THIS SECTION -->
  14. <html>
  15. <head>
  16. <title>The Code Project</title>
  17. <Style>
  18. BODY, P, TD { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt }
  19. H2,H3,H4,H5 { color: #ff9900; font-weight: bold; }
  20. H2 { font-size: 13pt; }
  21. H3 { font-size: 12pt; }
  22. H4 { font-size: 10pt; color: black; }
  23. PRE { BACKGROUND-COLOR: #FBEDBB; FONT-FAMILY: "Courier New", Courier, mono; WHITE-SPACE: pre; }
  24. CODE { COLOR: #990000; FONT-FAMILY: "Courier New", Courier, mono; }
  25. </style>
  26. <link rel="stylesheet" type=text/css href="http://www.codeproject.com/styles/global.css">
  27. </head>
  28. <body bgcolor="#FFFFFF" color=#000000>
  29. <!--------------------------------------------------------------------------->
  30. <!------------------------------- STEP 1 --------------------------->
  31. <!-- Fill in the details (CodeProject will reformat this section for you) -->
  32. <pre>
  33. Title: ReHash
  34. Author: Dominik Reichl
  35. Email: dominik.reichl@t-online.de
  36. Environment: VC++ 5.0-7.0, NT 4.0, Win95/98/ME, Win2k, WinXP
  37. Keywords: Hash, Security, Cryptography, Win32
  38. Level: Intermediate&quot;
  39. Description: A console-based hash calculator. Supported algorithms: CRC-16, CRC-16-CCITT, CRC-32, FCS-16, FCS-32, GHash-32-3, GHash-32-5, GOST-Hash, HAVAL-5-256, MD2, MD4, MD5, SHA-1, SHA-256, SHA-384, SHA-512, Tiger.
  40. Section Cpp
  41. SubSection Cryptography
  42. </pre>
  43. <!------------------------------- STEP 2 --------------------------->
  44. <!-- Include download and sample image information. -->
  45. <ul class=download>
  46. <li><a href="rehash_exe.zip">Download Win32 executable - 167 Kb </a></li>
  47. <li><a href="rehash_src.zip">Download source code - 276 Kb</a></li>
  48. </ul>
  49. <p><img src="rehash.jpg" alt="ReHash screenshot" width="572px" height="341px"></p>
  50. <!------------------------------- STEP 3 --------------------------->
  51. <!-- Add the article text. Please use simple formatting (<h2>, <p> etc) -->
  52. <br>
  53. <h2>Contents</h2>
  54. <ul>
  55. <li><a href="#reintro">Introduction</a></li>
  56. <li><a href="#realgos">Supported algorithms</a></li>
  57. <li><a href="#reusage">Usage</a></li>
  58. <li><a href="#rethanks">Thanks / acknowledgements</a></li>
  59. </ul>
  60. <br>
  61. <h2><a name="reintro">Introduction</a></h2>
  62. ReHash is a free, open source console-based hash calculator.<br><br>
  63. You can disable hash algorithms selectively per command-line if you don't need
  64. or like them, you can choose if you want to use recursive directory scanning or not.<br><br>
  65. This tool is ideal for webmasters who wish to provide their users hash values of
  66. their (downloadable) files. The complete hashing process can be automated by using a
  67. shell/batch script. No additional user interaction is needed (i.e. the program
  68. won't ask for anything, it's just using the command-line).
  69. <br><br>
  70. ReHash is distributed under the terms of the GNU General Public License v2.
  71. <br><br>
  72. <br>
  73. <h2><a name="realgos">Supported algorithms</a></h2>
  74. The current version of ReHash supports the following hash algorithms:<br><br>
  75. <table width="100%" border="1">
  76. <tr bgColor="#F0F0F0">
  77. <td><center><b>Algorithm</b></center></td>
  78. <td><center><b>Standard</b></center></td>
  79. <td><center><b>Inventor</b></center></td>
  80. <td><center><b>Hash Digest Size</b></center></td>
  81. </tr>
  82. <tr><td>CRC-16</td>
  83. <td>&nbsp;</td>
  84. <td>&nbsp;</td>
  85. <td><div align="right">16 bits</div></td></tr>
  86. <tr bgColor="#F0F0F0"><td>CRC-16-CCITT</td>
  87. <td>&nbsp;</td>
  88. <td>&nbsp;</td>
  89. <td><div align="right">16 bits</div></td></tr>
  90. <tr><td>CRC-32</td>
  91. <td>ANSI X3.66, FIPS PUB 71</td>
  92. <td>&nbsp;</td>
  93. <td><div align="right">32 bits</div></td></tr>
  94. <tr bgColor="#F0F0F0"><td>FCS-16</td>
  95. <td>&nbsp;</td>
  96. <td>&nbsp;</td>
  97. <td><div align="right">16 bits</div></td></tr>
  98. <tr><td>FCS-32</td>
  99. <td>&nbsp;</td>
  100. <td>&nbsp;</td>
  101. <td><div align="right">32 bits</div></td></tr>
  102. <tr bgColor="#F0F0F0"><td>GHash (GHash-32-3, GHash-32-5)</td>
  103. <td>-</td>
  104. <td>-</td>
  105. <td><div align="right">32 bits</div></td></tr>
  106. <tr><td>GOST-Hash</td>
  107. <td>R 34.11-94</td>
  108. <td>&nbsp;</td>
  109. <td><div align="right">256 bits</div></td></tr>
  110. <tr bgColor="#F0F0F0"><td>HAVAL (5 passes, 256 bits)</td>
  111. <td>&nbsp;</td>
  112. <td>Zheng, Pieprzyk,<br>Seberry</td>
  113. <td><div align="right">256 bits</div></td></tr>
  114. <tr><td>MD2</td>
  115. <td>RFC 1319</td>
  116. <td>Rivest</td>
  117. <td><div align="right">128 bits</div></td></tr>
  118. <tr bgColor="#F0F0F0"><td>MD4</td>
  119. <td>RFC 1320</td>
  120. <td>Rivest</td>
  121. <td><div align="right">128 bits</div></td></tr>
  122. <tr><td>MD5</td>
  123. <td>RFC 1321</td>
  124. <td>Rivest</td>
  125. <td><div align="right">128 bits</div></td></tr>
  126. <tr bgColor="#F0F0F0"><td>SHA-1</td>
  127. <td>FIPS PUB 180-1</td>
  128. <td>NIST/NSA</td>
  129. <td><div align="right">160 bits</div></td></tr>
  130. <tr><td>SHA-2 (SHA256/SHA384/SHA512)</td>
  131. <td>&nbsp;</td>
  132. <td>NIST/NSA</td>
  133. <td><div align="right">256/384/512 bits</div></td></tr>
  134. <tr bgColor="#F0F0F0"><td>SizeHash-32</td>
  135. <td>-</td>
  136. <td>-</td>
  137. <td><div align="right">32 bits</div></td></tr>
  138. <tr><td>Tiger</td>
  139. <td>&nbsp;</td>
  140. <td>Anderson, Biham</td>
  141. <td><div align="right">192 bits</div></td></tr>
  142. </table>
  143. <br><br>
  144. <h2><a name="reusage">Usage</a></h2>
  145. <pre>rehash.exe [options] filespec [&gt; outputfile]</pre>
  146. <br>
  147. The command-line is parsed from the left to the right. So if you execute ReHash like this:
  148. <pre>rehash.exe -all -none *.*</pre>
  149. it will output nothing, because you first activate all algorithms and then deactivate them
  150. all.<br><br>
  151. <br>
  152. <b>Some usage examples:</b><br><br>
  153. Hash all INI files in C:\Windows (including subdirectories) using all hash algorithms:
  154. <pre>rehash.exe C:\Windows\*.ini</pre><br>
  155. Hash all INI files in C:\Windows (excluding subdirectories) using all hash algorithms:
  156. <pre>rehash.exe -norecur C:\Windows</pre><br>
  157. Hash all BAT files on C:\ (including subdirectories) using only MD5 and SHA-1
  158. (remember command-line is parsed from the left to the right):
  159. <pre>rehash.exe -none -md5 -sha1 C:\*.bat</pre><br>
  160. Hash all files in C:\Temp (excluding subdirectories) using only the GOST algorithm:
  161. <pre>rehash.exe -norecur -none -gost C:\Temp\*</pre><br>
  162. Hash all ZIP files in C:\homepage (including subdirectories) using only the MD5 algorithm
  163. and output the hashes to C:\homepage\downloads\hashes.txt:
  164. <pre>rehash.exe -none -md5 C:\homepage\*.zip &gt; C:\homepage\downloads\hashes.txt</pre><br>
  165. <b>All options:</b><br><br>
  166. <table width="100%" border="1">
  167. <tr bgColor="#F0F0F0">
  168. <td width="25%"><center><b>Option</b></center></td>
  169. <td><center><b>Description</b></center></td>
  170. </tr>
  171. <tr><td>-help / -h / -?/<br>-version / -v</td>
  172. <td>Print some information about ReHash.</td></tr>
  173. <tr><td>-fullpath / -f</td>
  174. <td>Output the full paths of hashed files.</td></tr>
  175. <tr><td>-nopath</td>
  176. <td>Just output the filenames of hashed files, not the full paths to the files.</td></tr>
  177. <tr><td>-rcrsv / -recur / -r</td>
  178. <td>Recursive scanning. Scan all files in the specified path including files in
  179. subdirectories.</td></tr>
  180. <tr><td>-norcrsv / -norecur</td>
  181. <td>Disable recursive scanning. Scan only the files in the specified path not
  182. including subdirectories.</td></tr>
  183. <tr><td>-all / -a</td>
  184. <td>Enable all algorithms.</td></tr>
  185. <tr><td>-none / -n</td>
  186. <td>Disable all algorithms.</td></tr>
  187. <tr><td>-crc16 / -nocrc16</td>
  188. <td>Enable/disable the CRC-16 algorithm.</td></tr>
  189. <tr><td>-crc16c / -nocrc16c</td>
  190. <td>Enable/disable the CRC-16-CCITT algorithm.</td></tr>
  191. <tr><td>-crc32 / -nocrc32</td>
  192. <td>Enable/disable the CRC-32 algorithm.</td></tr>
  193. <tr><td>-fcs16 / -nofcs16</td>
  194. <td>Enable/disable the FCS-16 algorithm.</td></tr>
  195. <tr><td>-fcs32 / -nofcs32</td>
  196. <td>Enable/disable the FCS-32 algorithm.</td></tr>
  197. <tr><td>-ghash3 / -noghash3</td>
  198. <td>Enable/disable the GHash-3 algorithm.</td></tr>
  199. <tr><td>-ghash5 / -noghash5</td>
  200. <td>Enable/disable the GHash-5 algorithm.</td></tr>
  201. <tr><td>-gost / -nogost</td>
  202. <td>Enable/disable the GOST-Hash algorithm.</td></tr>
  203. <tr><td>-haval / -nohaval</td>
  204. <td>Enable/disable the HAVAL-5-256 algorithm.</td></tr>
  205. <tr><td>-md2 / -nomd2</td>
  206. <td>Enable/disable the MD2 algorithm.</td></tr>
  207. <tr><td>-md4 / -nomd4</td>
  208. <td>Enable/disable the MD4 algorithm.</td></tr>
  209. <tr><td>-md5 / -nomd5</td>
  210. <td>Enable/disable the MD5 algorithm.</td></tr>
  211. <tr><td>-sha1 / -nosha1</td>
  212. <td>Enable/disable the SHA-1 algorithm.</td></tr>
  213. <tr><td>-sha256 / -nosha256</td>
  214. <td>Enable/disable the SHA-256 algorithm.</td></tr>
  215. <tr><td>-sha384 / -nosha384</td>
  216. <td>Enable/disable the SHA-384 algorithm.</td></tr>
  217. <tr><td>-sha512 / -nosha512</td>
  218. <td>Enable/disable the SHA-512 algorithm.</td></tr>
  219. <tr><td>-size32 / -nosize32</td>
  220. <td>Enable/disable the Size-32 algorithm (simply the byte-count of the message).</td></tr>
  221. <tr><td>-tiger / -notiger</td>
  222. <td>Enable/disable the TIGER algorithm.</td></tr>
  223. </table>
  224. <br><br>
  225. <h2><a name="rethanks">Thanks / acknowledgements</a></h2>
  226. Thanks to (no particular order):
  227. <ul>
  228. <li>Markku-Juhani O. Saarinen - GOST-Hash implementation</li>
  229. <li>Yuliang Zheng - HAVAL implementation</li>
  230. <li>Wei Dai - implementations of various algorithms</li>
  231. <li>Dr Brian Gladman - SHA-1/SHA-2 implementation</li>
  232. <li>Tom St Denis - Tiger implementation</li>
  233. </ul>
  234. <br>
  235. <h2>History</h2>
  236. <ul>
  237. <li><b>12 April 2003 - v1.0</b><br>
  238. First public release</li>
  239. </ul>
  240. <br>
  241. <!------------------------------- That's it! --------------------------->
  242. </body>
  243. </html>