-
Notifications
You must be signed in to change notification settings - Fork 1
/
katsumi.py
101 lines (69 loc) · 1.98 KB
/
katsumi.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
95
96
97
98
99
100
101
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from ressources import interactions as it
from core.symmetric.galois_Z2 import GF2
import ressources.asciiWarehouse as asc
import sys
#################################################
################## Selection ###################
#################################################
def work_with_selection(pSelection):
"""Interact with others py functions depending on user choice."""
it.clear()
asc.asciiCat()
# Selection orientation
if pSelection == 1:
it.katsuSymm()
elif pSelection == 2:
it.katsuAsymm()
elif pSelection == 3:
it.katsuHash()
elif pSelection == 4:
it.certificate()
elif pSelection == 5:
it.katsuBlockChain()
elif pSelection == 6:
return it.primeNumbersFountain()
elif pSelection in [7, -1]:
asc.asciiGoodBye()
sys.exit()
else:
it.clear()
menu()
#################################################
################## MENU ########################
#################################################
def menu():
it.clear()
choices = [
"Symmetric",
"Asymmetric",
"Hash",
"Get X509 Certificate",
"BlockChain",
"Prime Numbers Fountain's",
"Exit",
]
if it.correctSizeHook():
print("------------------------------------------------------------------")
asc.asciiCat()
print("- Created by: Gobinet Théo && Martin Azaël ")
print("- Free to use")
print("- MIT License\n")
it.enumerateMenu(choices)
try:
selection = it.getInt(1, "choices")
work_with_selection(selection)
except KeyboardInterrupt:
work_with_selection(-1)
else:
menu()
def main():
it.clear()
# Directory initialisation
it.handleDirectory("processing")
# Galois field's initialization
GF2(16)
menu()
if __name__ == "__main__":
main()