forked from vricosti/ech0raix_decryptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
decrypt.py
31 lines (21 loc) · 735 Bytes
/
decrypt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
import os
from Crypto.Cipher import AES
from Crypto import Random
def decrypt(key, ciphered_filepath):
with open(ciphered_filepath,"rb") as f:
content = f.read()
if len(content) > 16:
iv = content[0:16]
cyphertext = content[16:]
cipher = AES.new(key, AES.MODE_CFB, iv)
plaintext = cipher.decrypt(cyphertext)
def main():
cur_path = os.path.dirname(os.path.realpath(__file__))
key = "4STDs9cmUlkiujXuLkdTouoqOIfER4TE"
for dirpath, subdirs, files in os.walk(cur_path):
for file in files:
if file.endswith('.encrypt'):
decrypt(key, os.path.join(dirpath, file))
if __name__ == "__main__":
main()