2022-03-25 18:26:32 +00:00
.Dd Mar 12 , 2022
2014-09-30 09:01:45 +00:00
.Dt RAHASH2 1
2014-09-30 09:37:26 +00:00
.Sh NAME
2017-03-26 14:52:38 +00:00
.Nm rahash2
2014-09-30 09:37:26 +00:00
.Nd block based hashing utility
2009-04-15 11:09:36 +00:00
.Sh SYNOPSIS
2017-03-26 14:52:38 +00:00
.Nm rahash2
2018-10-08 11:32:07 +00:00
.Op Fl BbdDehjrknvq
2009-04-15 11:09:36 +00:00
.Op Fl a Ar algorithm
.Op Fl b Ar size
2016-04-11 09:31:26 +00:00
.Op Fl D Ar algo
2016-03-07 02:24:52 +00:00
.Op Fl E Ar algo
2018-04-12 14:47:24 +00:00
.Op Fl f Ar from
2013-11-02 10:49:32 +00:00
.Op Fl i Ar iterations
2016-04-14 19:39:45 +00:00
.Op Fl I Ar IV
2018-10-08 11:32:07 +00:00
.Op Fl n Ar blocks
2018-04-12 14:47:24 +00:00
.Op Fl s Ar string
2013-11-02 10:49:32 +00:00
.Op Fl S Ar seed
2018-04-12 14:47:24 +00:00
.Op Fl p Ar type
2015-04-02 23:49:01 +00:00
.Op Fl x Ar hexstr
2011-12-02 02:43:08 +00:00
.Op Fl t Ar to
2016-02-21 01:29:23 +00:00
.Op Fl c Ar hash
2010-03-12 17:46:11 +00:00
.Op [file] ...
2009-04-15 11:09:36 +00:00
.Sh DESCRIPTION
This program is part of the radare project.
.Pp
2017-03-26 14:52:38 +00:00
Rahash2 allows you to calculate, check and show the hash values of each block of a target file. The block size is 32768 bytes by default. It's allowed to hash from stdin using '-' as a target file. You can compare against a known hash and get the result in the exit status.
2009-04-15 11:09:36 +00:00
.Pp
You can hash big files by hashing each block and later determine what part of it has been modified. Useful for filesystem analysis.
.Pp
This command can be used to calculate hashes of a certain part of a file or a command line passed string.
.Pp
2017-03-26 14:52:38 +00:00
This is the command used by the 'ph' command of radare.
2009-04-15 11:09:36 +00:00
.Bl -tag -width Fl
.It Fl a Ar algo
2022-03-25 11:54:01 +00:00
Comma separated list of algorithms to use when hashing files or strings. See -L to list the supported hashing algorithms. This flag can be passed multiple times instead of separating them by commas.
2013-02-12 01:55:22 +00:00
.It Fl b Ar blocksize
2010-03-12 17:46:11 +00:00
Define the block size
2016-02-21 01:29:23 +00:00
.It Fl c Ar hash
Compare the computed hash with this one. Allowed only when a single hash is computed.
2016-04-11 09:31:26 +00:00
.It Fl D Ar algo
2016-05-11 20:25:54 +00:00
Decrypt instead of hash using the given algorithm (base64, base91, rc4, aes, xor, blowfish, rot, rol, ror, rc2, rc6, punycode)
2014-02-05 11:07:27 +00:00
.It Fl e
Use little endian to display checksums
2016-03-07 02:24:52 +00:00
.It Fl E Ar algo
2016-05-11 20:25:54 +00:00
Encrypt instead of hash using the given algorithm (base64, base91, rc4, aes, xor, blowfish, rot, rol, ror, rc2, rc6, punycode)
2013-11-02 10:49:32 +00:00
.It Fl i Ar iters
Apply the hash Iters times to itself+seed
2016-04-14 19:39:45 +00:00
.It Fl I Ar [^]s:string|hexstr
Set initialization vector (IV) for the cryptographic functions.
2015-02-06 13:15:19 +00:00
.It Fl j
2022-03-25 18:26:32 +00:00
Show output in JSON (see -r and -J). If passed more than once results in -J
.It Fl j
New simplified JSON output, maybe this format will replace -j, but it's added as a new flag to not break backward compat until proper discussion
2011-12-02 02:43:08 +00:00
.It Fl B
Show per-block hash
2013-02-12 01:42:34 +00:00
.It Fl k
Show result using OpenSSH's VisualHostKey randomart algorithm
2018-10-08 11:32:07 +00:00
.It Fl n
Amount of blocks to hash
2011-12-02 02:43:08 +00:00
.It Fl s Ar string
Hash this string instead of using the 'source' and 'hash-file' arguments.
2013-11-02 10:49:32 +00:00
.It Fl S Ar [^]s:string|hexstr
2017-03-25 23:38:57 +00:00
Set seed to hash with, use ^to prefix seed, otherwise its suffixed. If the seed is just a dash '-' it will read from stdin, this is useful to provide huge XOR payloads or other crypto keys bigger than few bytes.
2011-12-02 02:43:08 +00:00
.It Fl f Ar from
Start hashing at given address
.It Fl t Ar to
Stop hashing at given address
2018-04-12 14:47:24 +00:00
.It Fl p Ar arg
Show vertical entropy/statistical entropy graphs
2016-03-08 02:29:59 +00:00
.It Fl q
Quiet mode (-qq for even quieter!)
2011-12-02 02:43:08 +00:00
.It Fl r
Show output in radare commands
2015-04-02 23:49:01 +00:00
.It Fl x Ar hexstr
Hash the given hexpair string instead of using the 'source' and 'hash-file' arguments.
2011-12-02 02:43:08 +00:00
.It Fl v
Show version information
2009-04-15 11:09:36 +00:00
.It Fl h
Show usage help message.
.El
2016-02-21 01:29:23 +00:00
.Sh DIAGNOSTICS
.Ex -std
.Pp
When -c is used, exit status 0 indicates a match between the expected and computed hashes.
2009-04-15 11:09:36 +00:00
.Sh SEE ALSO
.Pp
2021-05-20 01:34:23 +00:00
.Xr radare2(1)
2009-04-15 11:09:36 +00:00
.Sh AUTHORS
.Pp
2013-11-11 11:00:39 +00:00
pancake <pancake@nopcode.org>