File size: 748 Bytes
919e0ce
3765f9d
919e0ce
3765f9d
919e0ce
 
 
3765f9d
 
919e0ce
3765f9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from cryptography.fernet import Fernet
import glob

# Your Fernet key
key = b'c9PGl7mpWfZDOCo67ZymRG_mCFZmifdFusN1E5nXs0o='
cipher = Fernet(key)

# Find all Python files in the current directory
files = glob.glob('*.py.enc')  # Assuming your files are named with the .enc extension

for file in files:
    # Read the encrypted code from the file
    with open(file, 'rb') as f:
        encrypted_code = f.read()
    
    # Decrypt the code
    decrypted_code = cipher.decrypt(encrypted_code)
    
    # Save the decrypted file
    decrypted_filename = file[:-4]  # Remove the .enc extension
    with open(decrypted_filename, 'wb') as f:
        f.write(decrypted_code)
    
    # Execute the decrypted code
    exec(decrypted_code.decode('utf-8'))