10-31-2022, 08:46 PM
OFB works like ECB on a single block
ECB:
crack:
OFB:
crack:
So basically XOR your PT with your CT manually, the result becomes the "hash". Then append the IV as salt to this hash, all in hex. Then you can crack the key.
ECB:
Quote:$ echo -n 4142434441424344 | xxd -r -p | openssl enc -des-ecb -K 1234123412341234 -nopad -provider legacy | xxd -ps
9310d43e89fc63fa
crack:
Quote:echo 1234123412341234 | xxd -r -p | ./hashcat -m 14000 9310d43e89fc63fa:4142434441424344
Status...........: Cracked
OFB:
Quote:$ echo 4956495649564956 | xxd -r -p | openssl enc -des-ecb -K 1234123412341234 -nopad -provider legacy | xxd -ps
347545b0d3d0955b
$ printf '%x\n' $((0x347545b0d3d0955b ^ 0x4142434441424344))
753706f49292d61f
crack:
Quote:$ printf '%x\n' $((0x753706f49292d61f ^ 0x4142434441424344))
347545b0d3d0955b
echo 1234123412341234 | xxd -r -p | ./hashcat -m 14000 347545b0d3d0955b:4956495649564956
Status...........: Cracked
So basically XOR your PT with your CT manually, the result becomes the "hash". Then append the IV as salt to this hash, all in hex. Then you can crack the key.