Reply to comment

bash decrypter with substitution

A friend of mine didn't remember the "real" password (es. v3ry1mp0rt4n7pas5w0r6) that he used to encrypt his file with this openssl syntax:

openssl aes-256-cbc -salt -in myfile -out myfile.enc -k v3ry1mp0rt4n7pas5w0r6

but he remembers the "original" password (es. veryimportantpassword) before haxor replacement (a=4, s=5, e=3, ...)
well, i think that this little script can be useful to resolve this "memory" problem:

#!/bin/bash

for i in `echo v{e,3}ry{i,1}mp{o,0}r{t,7}{a,4}n{t,7}p{a,4}{s,5}{s,5}w{o,0}r{d,6}`
do
        openssl aes-256-cbc -d -salt -in myfile.enc -out myfile_$i.txt -k $i &> /dev/null
        if [ "$?" -ne "0" ]
        then
                rm -f myfile_$i.txt
        elif [ "`file -b myfile_$i.txt`" == "data" ] # false positive
        then
                rm -f myfile_$i.txt
        fi
done

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.