RAHASH2(1)
π RAHASH2(1) π
okay bestie, gather round, because this is rahash2 β the Block-Based Hashing, Encoding, and Encryption Utility β and she is that girl. one command, so many glow-ups. β¨
π SYNOPSIS π
rahash2 [-BehjkLqRrvX] [-b S] [-a A] [-c H] [-E A] [-D A] [-s S] [-f O]
[-t O] [-i num] [-I iv] [-S seed] [-x hexstr] [file ...]
π¦ DESCRIPTION π¦
so basically? this little icon computes, verifies and shows off hash values for each block of a file, and the default block size is 32768 bytes, no cap. you can feed her from standard input using - (yes, just the dash, she gets it), and she also supports comparing against hashes you already know about, using exit status codes as the vibe check. π
she's commonly used for forensic analysis, for detecting file modifications, and for chewing through big files efficiently β main character energy, honestly.
she also supports entropy calculation, targeted hashing of file segments or strings, and encoding, decoding, encryption and decryption with a whole roster of cryptographic algorithms. it's giving full-stack.
β¨ the flags, aka her entire personality β¨
-a algoβ comma separated list of algorithms (default is'sha256')-b bsizeβ specify the size of the block (instead of full file)-Bβ show per-block hash-c hashβ compare with this hash-eβ swap endian (use little endian)-E algoβ encrypt. use-Sto set key and-Ito set IV-D algoβ decrypt. use-Sto set key and-Ito set IV-f fromβ start hashing at given address-i numβ repeat hash N iterations (f.ex:3DES)-I ivβ use give initialization vector (IV) (hexa ors:string)-jβ output in json-Jβ new simplified json output (same as-jj)-S seedβ use given seed (hexa ors:string) use^to prefix (key for-E) (-will slurp the key from stdin, the@prefix points to a file)-kβ show hash using the openssh's randomkey algorithm-qβ run in quiet mode (-qqto show only the hash)-Lβ list muta plugins (combines with-q, used by-a,-Eand-D)-rβ output radare commands (comments), for example:
$ rahash2 -a sha1 -r file | r2 -qni file
-Rβ output radare2 sdb commands to store hashes underfile.<algo>keys (works with any algorithm name), for example:
$ rahash2 -a sha1 -R file | r2 -qni file
π¨ heads up bestie:rahash2 -Ris incompatible with-B(per-block hashing). do not try it. pick a lane.
-s stringβ hash this string instead of files-t toβ stop hashing at given address-x hexstrβ hash this hexpair string instead of files-Xβ output in hexpairs instead of binary/plain-vβ show version information
πΈ ENVIRONMENT πΈ
Rahash2 does not use any environment variables. she's low maintenance like that. π zero opinions, zero drama, just vibes.
π EXAMPLES π
calculate the MD5 hash of the 'ls' binary:
$ rahash2 -qqa md5 /bin/ls
calculate the SHA256 hash of string from stdin:
$ echo -n "Hello, World" | rahash2 -a sha256 -
$ rahash2 -a sha256 -s "Hello, World"
compare CRC32 of the given file didnt changed:
$ rahash2 -qqa crc32 /bin/ls
63212007
$ rahash2 -a crc32 -c 63212007 /bin/ls
INFO: Computed hash matches the expected one
$ echo $?
0
list all muta (hash, crypto, encoder, charset) plugins:
$ rahash2 -L
encode the string "Hello World" with base64:
$ rahash2 -E base64 -s "Hello World"
calculate SHA256 hash of a specific part of a file:
$ rahash2 -qqa sha256 -f 0x1000 -t 0x2000 file_to_hash
encrypt and decrypt the "hello" string using the ror and rol plugins:
$ rahash2 -S 12333 -E ror -s hello && echo
Cell{
$ rahash2 -S 12333 -E rol -s Cell{ && echo
hello
encrypting and decrypting using AES-CBC:
$ export AES_KEY="11111111111111111111111111113211"
$ rahash2 -E aes-ecb -S "$AES_KEY" -s "hello world you bastard" > .file
$ cat .file | rahash2 -D aes-ecb -S "$AES_KEY" -s - && echo
encrypting a file using Blowfish and encode it into a json:
$ rahash2 -E blowfish -S "11111111111111111111111111113211" -j /bin/ls > ls.json
π«Ά DIAGNOSTICS π«Ά
the rahash2 utility exits 0 on success, and >0 if an error occurs. simple as.
when using the -c flag, an exit status of 0 indicates a match between the expected and computed hashes. queen of accountability. π
π SEE ALSO π
π AUTHORS π
pancake <pancake@nopcode.org>
and that's the whole page, bestie! this lil bundle of joy was written up on Jul 10, 2025, and it lives in the RAHASH2(1) section of the manual β go forth and hash responsibly. mwah. πβ¨π
π¦ where this page comes from
- alpine 3.24: radare2-doc 6.1.6-r0 Β· GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: radare2 6.2.2-1 Β· GPL-3.0-only AND LGPL-3.0-only
- nixos 26.05: radare2 6.1.8
- nixpkgs unstable: radare2 6.2.4
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- ubuntu stonking: radare2 6.1.8+ds-1 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms