-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (43 loc) · 1.45 KB
/
main.py
File metadata and controls
49 lines (43 loc) · 1.45 KB
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
import utils.encryption as encryption
import utils.func as func
#Welcome
func.welcome("Crypto-Script")
#Choosing what kind of operation the user want
action, type_action=func.choose_action()
# value action= "Encrypt"/"Decrypt"/"Generate key"/"Hash"/"Cancel"
# value type_action
# for Encrypt and Decrypt:
# "Symmetric"/"Asymmetric"
# for Generate key:
# "Private key"/"Public key"
if action=='encrypt':
if type_action=='asymmetric':
file=encryption.Asymmetric_Encryption()
file.encrypt()
elif type_action=='symmetric':
file=encryption.Symmetric_Encryption()
file.encrypt()
elif action=='decrypt':
if type_action=='asymmetric':
file=encryption.Asymmetric_Encryption()
file.decrypt()
elif type_action=='symmetric':
file=encryption.Symmetric_Encryption()
file.decrypt()
elif action=='generate key':
if type_action=='private key':
encryption.Asymmetric_Encryption.generate_private_key()
elif type_action=='public key':
encryption.Asymmetric_Encryption.generate_public_key()
elif type_action=='encrypt private key':
encryption.Asymmetric_Encryption.encrypt_private_key()
elif action=='hash':
if type_action=='create':
file=encryption.Hash()
file.create_hash()
elif type_action=='sign':
file=encryption.Hash()
file.sign_hash()
elif type_action=='verify':
file=encryption.Hash()
file.verify_hash()