RAHASH2(1) | General Commands Manual | RAHASH2(1) |
rahash2
—
block-based hashing, encoding and encryption
utility
rahash2 |
[-BbdehjkLqrv ] [-a
algo] [-b
size] [-c
hash] [-D
deco] [-e ]
[-E enco]
[-f from]
[-i num]
[-I iv]
[-j ] [-J ]
[-L ] [-S
seed] [-k ]
[-s string]
[-t to]
[-x hexstr]
[-X ] [-v ]
[[file] ...] |
This program is part of the radare project.
It's particularly useful for hashing large files and identifying modifications in forensics filesystem analysis.
This command provides the same features as the 'ph' command of radare.
-a
algo-b
size-c
hash-D
deco-e
-E
enco-f
from-i
num-I
iv-j
-J
-k
-L
-s
string-S
seed-t
to-x
hexstr-X
-v
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 only the cryptographic plugins loaded:
$ rahash2 -L | grep ^c
$ rahash2 -qqa crc32 /bin/ls
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
The rahash2
utility exits 0 on
success, and >0 if an error occurs.
When using the -c flag, an exit status of 0 indicates a match between the expected and computed hashes.
https://www.radare.org/
pancake <pancake@nopcode.org>
March 16, 2024 |