-
Notifications
You must be signed in to change notification settings - Fork 1
/
senitel
108 lines (89 loc) · 2.94 KB
/
senitel
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env python3
#import modules
import os,sys,hashlib,getpass,pyAesCrypt
from tkinter import *
import tkinter as tki
#data buffer
buff=1024*1024*128
#window
root=tki.Tk()
Height=300
Width=400
#securely erase files
def delete(file):
os.system(f'rm -rf {file}')
txt='.'
#creates file to remove traces of the deleted file
open('.f','w').write(txt)
num=0
while True:
txt+='..................'
#writes data to file to remove traces of deleted file
open('.f','w').write(txt)
os.system('rm -rf f')
if num>99:
break
num+=0.1
#hashes the password and seed
def hashing_algorithm(key,seed):
key=f'*%|E{seed}(0{key}^2f#bw$'
n==0
while True:
key=hashlib.sha256(key.encode('utf8')).hexdigest()
n+=1
if n>=10128:
return(key)
#decrypt data
def decrypt(key,seed):
key=hashing_algorithm(key,seed)
pyAesCrypt.decryptFile('.senitel.encrypt','vault.zip',key,1024*1024*128) #decrypt with AES-256 to get zip file
os.system('rm -rf .senitel.encrypt')
os.system('unzip vault')
os.system('rm -rf vault.zip')
t=Label(text=' ***Senitel Unlocked*** ')
t.place(x=100,y=175)
#encrypt data
def encrypt(key,seed):
key=hashing_algorithm(key,seed)
os.system('zip vault -0 -r vault')
os.system('rm -rf vault')
pyAesCrypt.encryptFile('vault.zip','.senitel.encrypt',key,1024*1024*128) #decrypt with AES-256 to get zip file
delete('vault.zip')
t=Label(text=' ***Senitel Locked*** ')
t.place(x=99,y=175)
def senitel(password,seed):
#checks if the vault is already encrypted
vault_file=os.path.exists('.senitel.encrypt')
#checks if the vault is decrypted
vault_vulnerable=os.path.exists('vault/')
if vault_vulnerable==True:
try:
encrypt(password,seed)
except Exception:
t=Label(text=' ***Password is Incorrect*** ')
t.place(x=99,y=175)
else:
try:
decrypt(password,seed)
except Exception:
t=Label(text=' ***Password is Incorrect*** ')
t.place(x=99,y=175)
#GUI
root.title('Senitel')
tki.Canvas(root,height=Height,width=Width).grid()
#frame
frame=tki.Frame(root,bg='black')
frame.place(relx=0.01,rely=0.01,relwidth=0.98,relheight=0.98)
#seed
entry=tki.Entry(frame,font=30,show='*')
entry.place(relwidth=0.65,relheight=0.11,y=125,x=66)
#password
entry2=tki.Entry(frame,font=30,show='*')
entry2.place(relwidth=0.65,relheight=0.11,y=40,x=66)
#button
tki.Button(root,text='enter',bg='white',fg='black',font=180,command=lambda:senitel(entry.get(),entry2.get())).place(relx=0.34,rely=0.73,relwidth=0.3,relheight=0.18)
#labels
t=Label(text='password:',bg='black',fg='white').place(x=165,y=18)
t2=Label(text='seed:',bg='black',fg='white').place(x=180,y=102)
#mainloop
root.mainloop()