0

I've recently found an old TrueCrypt volume file of mine, but after an hour of trying out different passwords I haven't found the right one. I know for a fact that I used a combination of old passwords, but it would take a very long time to try all combinations by hand. I've tried different programs (such as Crunch) to construct a wordlist, but all they do is to generate combinations of every single entry in the .txt-file.

So my question is: does anyone know of a program that could combine all the entries in the file, but only in pairs of two?

For example:

String 1 = hello

String 2 = bye

output =

hellobye

byehello

Michael Kaesy
  • 127
  • 1
  • 10
  • you could easily write a program to do this. Although truecrypt is security related your question isnt... –  Mar 06 '13 at 23:37
  • Unfortunately, I am not a programmer, so I simply cannot program it myself at the moment. This is why I asked for an already made program or piece of code that could accomplish this. – Michael Kaesy Mar 06 '13 at 23:41
  • How long is your list? The result is going to be a Cartesian product, so it could end up immensely large very quickly. Can you give a general (or exact would be even better) idea of the number of words in the list? – Xander Mar 07 '13 at 00:00
  • 10 lines at the moment, so it isn't anything massive, but I keep remembering new passwords from time to time. – Michael Kaesy Mar 07 '13 at 00:24

2 Answers2

2

Under windows, the following command will combine all combinations of two passwords into a new file, using a plain text file as input with line-seperated passwords.

for /F "tokens=*" %i in (passwords.txt) do @(
    for /F "tokens=*" %j in (passwords.txt) do
        @echo %i%j
)>> combinations.txt
1

Sample wordlist: cat list.txt

a
b
c
d

Script: cat list.py:

words = []
file = open('list.txt', 'r')
for word in file.readlines():
    words.append(word.replace('\n', ''))

#i - 1 is to prevent extending past the end of the list on last try
for i in range(len(words) - 1):
    #i + 1 is to prevent "wordword"
    for j in range(i + 1, len(words)):
        print words[i] + words[j]
        print words[j] + words[i]

Output: python list.py

ab
ba
ac
ca
ad
da
bc
cb
bd
db
cd
dc
Jeff Ferland
  • 17,832
  • 7
  • 46
  • 76