#!/bin/sh

DIR="/tmp/btc310"
[ ! -d $DIR ] && mkdir -p $DIR
PASSWD="$1";
FILE="$2";
for i in $(openssl enc -ciphers 2>&1 | tail -n +2 | xargs | sed 's/ -/ /g' | sed 's/^.//'); do
	openssl enc -d -$i -md md5 -a -k "$PASSWD" -in "$FILE" -out $DIR/$i.dec 2> /dev/null
	if [ $? -ne 0 -o ! -s $DIR/$i.dec ]; then
		rm $DIR/$i.dec
	else
		strings $DIR/$i.dec | grep Bitcoin >/dev/null && { echo $DIR/$i.dec; cat $DIR/$i.dec; }
	fi
done
