1RHASH(1)                         User Manuals                         RHASH(1)
2
3
4

NAME

6       rhash - calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other hash
7       sums.
8

SYNOPSIS

10       rhash [ option ]... [ file ]...
11

DESCRIPTION

13       RHash (Recursive Hasher) computes and verifies various message  digests
14       (hash  sums)  of  files  or  strings. Supported message digests include
15       CRC32, CRC32C, MD4, MD5, SHA1, SHA256, SHA512, SHA3, Tiger,  DC++  TTH,
16       BTIH,  AICH, ED2K, GOST R 34.11-*, RIPEMD-160, HAS-160, EDON-R 256/512,
17       Whirlpool, Snefru-128/256.
18
19       The program can create and verify  Magnet  links  and  eDonkey  ed2k://
20       links, see --magnet and --ed2k-link options.
21
22       A dash string parameter `-' is interpreted as stdin file.
23
24       By  default  rhash  prints sums in SFV format with CRC32 hash sum only.
25       The format  can  be  changed  by  options  --bsd,  --magnet,  --simple,
26       --printf, --template.  To output all sums use the `-a' option.
27
28       The  default  output  format  can be changed by renaming the program or
29       placing a hardlink/symlink to it with  a  filename  containing  strings
30       `crc32',  `crc32c',  `md4',  `md5', `sha1', `sha256' `sha512', `tiger',
31       `tth', `btih', `aich', `ed2k', `ed2k-link', `gost12-256', `gost12-512',
32       `gost94',   `gost94-cryptopro',   `ripemd160',  `has160',  `whirlpool',
33       `edonr256', `edonr512', `snefru128', `snefru256', `sfv' or `magnet'.
34
35

PROGRAM MODE OPTIONS

37       The default mode is to print hash sums  for  all  files  and  directory
38       trees  specified  by command line. The mode can be set by the following
39       options.
40
41       -c, --check
42              Check hash files specified by command  line.  RHash  can  verify
43              hash  files in SFV and BSD formats, standard MD5 and SHA1 files,
44              and text files containing magnet or ed2k  links  (one  link  per
45              line).   Empty  lines  and  lines  starting  with `;' or `#' are
46              skipped.  In fact RHash can verify most hash files generated  by
47              itself without formatting options --printf and --template.
48
49       -u, --update
50              Update hash files specified by command line.  The program calcu‐
51              lates and appends hashes to the updated hash file in the  format
52              specified  by  formatting  options.   Hashes  are calculated for
53              those files from the same directory as the hash file, which  are
54              yet not present in it.
55
56       -k, --check-embedded
57              Verify files by crc32 sum embedded in their names.
58
59       --torrent
60              Create a torrent file for each processed file.
61
62       -h, --help
63              Help: print help screen and exit.
64
65       -V, --version
66              Version: print version and exit.
67
68       -B, --benchmark
69              Run benchmark for selected algorithm(s).
70
71

HASH SUMS OPTIONS

73       -C, --crc32
74              CRC32: calculate and print CRC32 hash sum.
75
76       --crc32c
77              CRC32C: calculate and print CRC32C hash sum.
78
79       --md4  MD4: calculate and print MD4 hash sum.
80
81       -M, --md5
82              MD5: calculate and print MD5 hash sum.
83
84       -H, --sha1
85              SHA1: calculate and print SHA1 hash sum.
86
87       --sha224, --sha256, --sha384, --sha512
88              Calculate specified SHA2 hash sum.
89
90       --sha3-224, --sha3-256, --sha3-384, --sha3-512
91              Calculate specified SHA3 hash sum.
92
93       --tiger
94              Tiger: calculate and print Tiger hash sum.
95
96       -T, --tth
97              TTH: calculate and print DC++ TTH sum.
98
99       --btih BTIH: calculate and print BitTorrent Info Hash.
100
101       -A, --aich
102              AICH: calculate and print AICH hash.
103
104       -E, --ed2k
105              ED2K: calculate and print eDonkey 2000 hash sum.
106
107       -L, --ed2k-link
108              eDonkey link: calculate and print eDonkey link.
109
110       -W, --whirlpool
111              Whirlpool: calculate and print Whirlpool hash sum.
112
113       -G, --gost12-256
114              GOST-2012:  calculate  and print 256-bit GOST R 34.11-2012 hash,
115              the Russian GOST standard hash function.
116
117       --gost12-512
118              GOST-2012: calculate and print 512-bit GOST R  34.11-2012  hash,
119              the Russian GOST standard hash function.
120
121       --gost94
122              GOST-94:  calculate  and  print GOST R 34.11-94 hash, the depre‐
123              cated Russian standard hash function.
124
125       --gost94-cryptopro
126              GOST-94-CRYPTOPRO: calculate and print CryptoPro version of  the
127              deprecated Russian GOST R 34.11-94 hash function.
128
129       --ripemd160
130              RIPEMD-160: calculate and print RIPEMD-160 hash sum.
131
132       --has160
133              HAS-160: calculate and print HAS-160 hash sum.
134
135       --snefru128, --snefru256
136              SNEFRU: calculate and print SNEFRU-128/256 hash sums.
137
138       --edonr256, --edonr512
139              EDON-R: calculate and print EDON-R 256/512 hash sums.
140
141
142       -a, --all
143              Calculate all supported hash sums.
144
145       --list-hashes
146              List names of all supported hashes, one per line.
147
148

MISCELLANEOUS OPTIONS

150       -r, --recursive
151              Recursively process directories, specified by command line.
152
153       --file-list=<file>
154              Process given file as a file-list. Lines of this file are inter‐
155              preted as paths to files to be processed.  Multiple  file  lists
156              can be specified at command line.
157
158       -m, --message=<text>
159              Calculate hash sums of the text message.
160
161       --follow
162              Follow symbolic links when processing directories recursively.
163
164       -v, --verbose
165              Be verbose.
166
167       --percents
168              Show percents, while calculating or checking sums
169
170       --skip-ok
171              Don't print OK messages for successfully verified files.
172
173       -i, --ignore-case
174              Ignore case of filenames when updating crc files.
175
176       --speed
177              Print per-file and the total processing speed.
178
179       -e, --embed-crc
180              Rename files by inserting crc32 sum into name.
181
182       --embed-crc-delimiter=<delimiter>
183              Insert specified <delimiter> before a crc sum in the --embed-crc
184              mode, default is white space. The <delimiter> can be a character
185              or empty string.
186
187       --path-separator=<separator>
188              Use specified path separator to display paths.
189
190       -q, --accept=<list>
191              Set  a  comma‐delimited  list  of  extensions  of  the  files to
192              process.
193
194       --exclude=<list>
195              Set a comma‐delimited list of extensions of the files to exclude
196              from processing.
197
198       -t, --crc-accept=<list>
199              Set  a  comma‐delimited  list of extensions of the hash files to
200              verify.
201
202       --maxdepth=<levels>
203              Descend at most <levels>  (a  non‐negative  integer)  levels  of
204              directories  below  the  command  line arguments. `--maxdepth 0'
205              means only apply the tests and actions to the command line argu‐
206              ments.
207
208       -o, --output=<file-path>
209              Set  the  file  to  output  calculated  hashes  and verification
210              results to.
211
212       -l, --log=<file-path>
213              Set the file to log errors and verbose information to.
214
215       --openssl=<list>
216              Specify which hash functions  should  be  calculated  using  the
217              OpenSSL  library.   The <list> is a comma delimited list of hash
218              names, but only those supported by  openssl  are  allowed,  e.g.
219              md4,  md5,  sha1,  sha256, ripemd160.  See openssl documentation
220              for the full list.
221
222       --gost-reverse
223              Reverse bytes in hexadecimal output of the GOST hash  sum.   The
224              most  significant  bytes  of  the  hash  will  be printed first.
225              Default order is the least significant bytes first.
226
227       --bt-batch=<file-path>
228              Turn on torrent batch mode (implies  torrent  mode).  Calculates
229              batch-torrent  for the files specified at command line and saves
230              the torrent file to the file-path. The option -r <directory> can
231              be useful in this mode.
232
233       --bt-private
234              Generate BTIH for a private BitTorrent tracker.
235
236       --bt-piece-length
237              Set the piece length value for torrent file.
238
239       --bt-announce=<announce-url>
240              Add a tracker announce URL to the created torrent file(s).  Sev‐
241              eral URLs can be  passed  by  specifying  the  option  mutltiple
242              times.  This option doesn't change the BTIH hash.
243
244       --benchmark-raw
245              Switch  benchmark  output  format  to be a machine‐readable tab‐
246              delimited text with hash function name, speed,  cpu  clocks  per
247              byte.   This  option  works  only  if the --benchmark option was
248              specified.
249
250       -- (double dash)
251              Mark the end of command line options. All  parameters  following
252              the  double  dash are interpreted as files or directories. It is
253              typically used to process filenames starting with  a  dash  `-'.
254              Alternatively  you  can  specify  './'  or full path before such
255              files, so they will not look like options anymore.
256
257

OUTPUT FORMAT OPTIONS

259       --sfv  Print hash sums in the SFV  (Simple  File  Verification)  output
260              format  (default).   But unlike common SFV file, not only CRC32,
261              but any hash sums specified by options can be printed.
262
263       -g, --magnet
264              Print hash sums formatted as magnet links.
265
266       --bsd  Use BSD output format. Each hash sum is printed on separate line
267              after hash name and file's path, enclosed in parentheses.
268
269       --simple
270              Use simple output format. Each line will consist of filename and
271              hash sums specified by options.
272
273       --uppercase
274              Print hash sums in upper case.
275
276       --lowercase
277              Print hash sums in lower case.
278
279       --template=<file>
280              Read printf‐like template from given <file>.  See  the  --printf
281              option.
282
283       -p, --printf=<format>
284              Format:  print  format  string the standard output, interpreting
285              `\' escapes and `%' directives. The escapes and directives are:
286
287              \n     Newline.
288
289              \r     Carriage return.
290
291              \t     Horizontal tab.
292
293              \\     A literal backslash (`\').
294
295              \0     ASCII NUL.
296
297              \NNN   The character which octal ASCII code is NNN.
298
299              \xNN   The character which hexadecimal ASCII code is NN.
300
301              A `\' character followed by any other character is treated as an
302              ordinary character, so they both are printed.
303
304              %%     A literal percent sign.
305
306              %p     File's path.
307
308              %f     File's name.
309
310              %u     URL‐encoded filename.
311
312              %s     File's size in bytes.
313
314              %{mtime}
315                     File's last modification time.
316
317              %a or %A
318                     AICH hash sum.
319
320              %c or %C
321                     CRC32  hash  sum.  Use %c for lowercase and %C for upper‐
322                     case characters.
323
324              %g or %G
325                     GOST R 34.11-94 hash.
326
327              %h or %H
328                     SHA1 hash.
329
330              %e or %E
331                     ED2K hash sum.
332
333              %l or %L
334                     EDonkey ed2k://... link.
335
336              %m or %M
337                     MD5 hash.
338
339              %r or %R
340                     RIPEMD-160 hash.
341
342              %t or %T
343                     TTH sum.
344
345              %w or %W
346                     Whirlpool hash.
347
348              %{crc32}, %{crc32c}, %{md4}, %{md5}, %{sha1}, %{tiger},  %{tth},
349              %{btih},    %{ed2k},    %{aich},   %{whirlpool},   %{ripemd160},
350              %{has160},   %{gost94},   %{gost94-cryptopro},    %{gost12-256},
351              %{gost12-512},  %{sha-224},  %{sha-256}, %{sha-384}, %{sha-512},
352              %{sha3-224},     %{sha3-256},     %{sha3-384},      %{sha3-512},
353              %{edon-r256}, %{edon-r512}, %{snefru128}, %{snefru256}
354                     Print  the  specified  hash  sum.  The hash is printed in
355                     uppercase, if the name of the hash sum starts with a cap‐
356                     ital letter, e.g. %{TTH}, %{Sha-512}.
357
358              %x<hash>, %b<hash>, %B<hash>, %@<hash>
359                     Use  one  of these prefixes to output a hash sum in hexa‐
360                     decimal, base32, base64 or raw  (binary)  format  respec‐
361                     tively, e.g. %b{md4}, %BH or %xT.
362
363

CONFIG FILE

365       RHash  looks  for  a  config  file  at  $XDG_CONFIG_HOME/rhash/rhashrc,
366       $HOME/.rhashrc and /etc/rhashrc.
367
368       The config file consists of lines formatted as
369              variable = value
370
371       where the variable can be a name of any command line option, like  mag‐
372       net, printf, percents, etc.  A boolean variable can be set to true by a
373       value `on', `yes' or `true', any  other  value  sets  the  variable  to
374       false.
375
376       Empty lines and lines starting with `#' or `;' are ignored.
377
378       Example config file:
379       # This is a comment line
380       percents = on
381       crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet
382
383

AUTHOR

385       Aleksey Kravchenko <rhash.admin@gmail.com>
386

SEE ALSO

388       md5sum(1) cksfv(1) ed2k_hash(1)
389

BUGS

391       Bug reports are welcome!  Send them by email or post to the SourceForge
392       Bug Tracking System http://sourceforge.net/projects/rhash/
393
394
395
396Linux                              APR 2010                           RHASH(1)
Impressum