On 27 April 2011 19:56, Mick <[email protected]> wrote:
> On Wednesday 27 April 2011 19:15:46 [email protected] wrote:
>> On Tue, Apr 26, 2011 at 09:24:44PM +0100, Mick wrote:
>> > Back to plan A. Any ideas how I can improve my script?
>>
>> Do you have any guesses as to your passphrase or is it a total shot in
>> the dark, could be anything from one word to a poem?
>>
>> Unless you can narrow it down tremendously, you're wasting time and it
>> will never be recovered.
>
> There are some candidate passphrases. I tried them all with rephrase and all
> the permutations that I could think of.
>
> Now I am trying app-crypt/nasty, for brute force cracking, but I can't get it
> to work. :-(
>
> It keeps popping up my pinentry and asking me for my default key passphrase,
> not the key I am trying to feed to it.
>
> Is there a way to change that script I posted so that it a)takes the
> passphrases from a file, or b)incrementally tries {a,b,...,z}, and/or capitals
> and/or numbers?
I'm making some good progress!
First I used the key to encrypt a file:
gpg -e file.txt
Then run this script to try to decrypt it:
==========================================
#!/bin/bash
#
# try all word in test.txt
for word in $(cat test.txt); do
# try to decrypt with word
echo "${word}" | gpg --passphrase-fd 0 -q --batch --no-tty --output
file_success.txt -d file.txt.gpg;
# if decrypt is successfull; stop
if [ $? -eq 0 ]; then
echo "GPG passphrase is: ${word}";
exit 0;
fi
done;
exit 1;
==========================================
This finds the passphrase and prints it out on the terminal. However, its
success depends on the dictionary file I use. Also, it's not particularly
fast ...
Any idea how I can create a dictionary file? I've used apg but it's <aheam!>
too random. :-)
I have been given something like 6 passphrases that may have been used. The
problem is that at the time of creation the passphrase was typed in
incorrectly (twice!) So I would need to use some method of generating a
dictionary with potential typos of these known passphrases (pretty much how
the rephrase application works). What is a good way to generate such a file
by imputing a range of candidate characters?
Finally, is there a way or parallelising the run so that it speeds up?
--
Regards,
Mick