Advertisement
Guest User

vim_blowfish_decrypt.py

a guest
Jan 3rd, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. with open("test_known.txt") as f:
  2.     with open("test.txt", 'rb') as e:
  3.         i,j = 0,0
  4.         e.seek(28)
  5.         output = ""
  6.         pad = [0,0,0,0,0,0,0,0]
  7.         for char in f.read():
  8.             if j == 0:
  9.                 char2 = e.read(1)
  10.                 pad[i] = ord(char) ^ ord(char2)
  11.                 output += chr(pad[i] ^ ord(char2))
  12.             else:
  13.                 output += chr(pad[i] ^ ord(e.read(1)))
  14.             i += 1
  15.             if i % 8 == 0:
  16.                 i = 0
  17.                 j = (j + 1) % 8
  18. print output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement