i was able to do it myself after going through the revelation-sourcecode which was hard for me since i don't know anything about python. i attached the small perl-script which creates all the possible combinations of the expected subscripts of the password, using every string only once. putting

aaa
bbb
ccc

into the file "words" should give you

aaa
aaabbb
aaabbbccc
aaaccc
aaacccbbb
bbb
bbbaaa
bbbaaaccc
bbbccc
bbbcccaaa
ccc
cccaaa
cccaaabbb
cccbbb
cccbbbaaa

just in case anyone need's it. there has to be an empty line at the end of "words". it's really a quick hack and the few comments are in german.

it should be possible to use the output of my script with the one you posted. i also attached my version which is an ugly copy-and-paste of the code i found in revelation and it only works if it's in the base-directory of revelation-sourcecode...

Attachment: generator3.pl
Description: Perl program

#!/usr/bin/python
import zlib
from Crypto.Cipher import AES
from revelation import util

AES.block_size = 16
AES.key_size = 32

f = file('passwordfile')
input_ = f.read()
f.close()

f = file('input.txt')
while True:
	line = f.readline()
	if len(line) == 0:
		break
	line = line.rstrip()

	password = util.pad_right(line[:32], 32, "\0")

	input = input_

	cipher = AES.new(password)
	iv = cipher.decrypt(input[12:28])

	input = input[28:]

	if len(input) % 16 != 0:
		print "Eingabe nicht durch 16 teilbar"
	
	cipher = AES.new(password, AES.MODE_CBC, iv)
	input = cipher.decrypt(input)

	padlen = ord(input[-1])
	for i in input[-padlen:]:
	    if ord(i) != padlen:
		    break
	    else:
		    try:
			    input = zlib.decompress(input[0:-padlen])
		    except:
			    a=3
		    else:
			    print input[:20]
			    print line[:24]

f.close()

Reply via email to