rendered paste body# -*- coding: utf-8 -*-
from Crypto.Cipher import Blowfish
import Crypto.Cipher
import array
bf = Blowfish.new("\x7c\x58\xa4\x49\x79\x63\xef\xa6\x32\xd1\xae\x86\x91\x82\xe7\x6a", Blowfish.MODE_ECB)
file = open("/home/olaf/filme/test/encrypted", "rb")
out = ""
backward = []
test = 1L
while True:
text = file.read(256)
if len(text) < 256:
break
arr = array.array('L', text)
arr.byteswap()
arr = array.array('L',bf.decrypt(arr.tostring()))
arr.byteswap()
out += arr.tostring()
back_text = file.read(256)
if len(back_text) < 256:
break
back_arr = array.array('L', back_text)
back_arr.byteswap()
back_arr = array.array('L',bf.decrypt(back_arr.tostring()))
back_arr.byteswap()
backward.append(back_arr.tostring())
for i in range(len(backward) - 1, 0, -1):
out += backward[i]
print out