Created
August 2, 2016 23:06
-
-
Save foogoof/bfa0e4f5425124b33039d1eff2bc8265 to your computer and use it in GitHub Desktop.
try all viable ow algorithms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# depends on a file named full.bin containing the base64 decoded contents of the message | |
# yes this is a mess, sorry I'm in a rush | |
CIPHERS="bf-cfb | |
bf-ofb | |
cast5-cfb | |
cast5-ofb | |
des-cfb | |
des-ede-cfb | |
des-ede-ofb | |
des-ede3-cfb | |
des-ede3-ofb | |
des-ofb | |
rc2-cfb | |
rc2-ofb | |
rc4 | |
rc4-40 | |
seed-cfb | |
seed-ofb | |
" | |
for cipher in $CIPHERS; do | |
base_cmd="openssl $cipher -d -kfile ow.pwd -in full.bin -out foo.$cipher.out" | |
rm -f foo.$cipher.out | |
$base_cmd 2>/dev/null | |
if [ $? = 0 ]; then | |
file_type=`file foo.$cipher.out` | |
pattern="foo.$cipher.out: data" | |
if [[ ! `file foo.$cipher.out` == $pattern ]]; then | |
echo -n "${cipher} " | |
echo -n "`file foo.$cipher.out` " | |
cat foo.$cipher.out | |
echo '' | |
fi | |
else | |
rm -f foo.$cipher.out | |
fi | |
done | |
# to run: | |
# echo -n 'password guess' > ow.pwd; ./ow.sh | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment