13
13
class Prompt (Cmd ):
14
14
def __init__ (self , cls ):
15
15
super (Prompt , self ).__init__ ()
16
- self .prompt = '{blue}program {cyan}(hashing) ➥ {reset}' .format (blue = cls ['BLUE' ], cyan = cls ['CYAN' ],
17
- reset = cls ['RESET' ])
16
+ self .prompt = '{blue}program {cyan}(hashing) ➥ {reset}' .format (blue = cls ['BLUE' ], cyan = cls ['CYAN' ], reset = cls ['RESET' ])
18
17
self .cls = cls
19
18
20
19
# We define the settings here
21
20
settings = {
22
21
'ALGO' : {
23
22
'value' : 'SHA-256' ,
24
- 'description' : 'The specific algorithm, use \' hashes \' for a complete list' ,
23
+ 'description' : 'Use \' algos \' for a complete list' ,
25
24
'required' : True
26
25
},
27
26
'TEXT' : {
@@ -31,12 +30,12 @@ def __init__(self, cls):
31
30
},
32
31
'HASH' : {
33
32
'value' : None ,
34
- 'description' : 'The hash to compare to (Only for comparing)' ,
33
+ 'description' : 'Hash to compare to (Only for comparing)' ,
35
34
'required' : False
36
35
},
37
36
'SALT' : {
38
37
'value' : None ,
39
- 'description' : 'The salt used for hashing (Auto-Gen) ' ,
38
+ 'description' : 'Additional safeguard value ' ,
40
39
'required' : False
41
40
}
42
41
}
@@ -49,7 +48,7 @@ def do_help(self, _ln):
49
48
['unset' , 'Unset a certain setting' ],
50
49
['hash' , 'Hash some text (configure first)' ],
51
50
['compare' , 'Compare a hash (setting: TEXT) with a generated hash (setting: HASH)' ],
52
- ['hashes ' , 'Obtain a list with supported hashes ' ],
51
+ ['algos ' , 'Obtain a list with supported hashing algorithms ' ],
53
52
]
54
53
print (tabulate (cmd_list , stralign = "center" , tablefmt = "fancy_grid" ,
55
54
headers = [self .cls ['BLUE' ] + "Command" + self .cls ['RESET' ],
@@ -149,14 +148,14 @@ def do_compare(self, _ln):
149
148
else :
150
149
print (self .cls ['RED' ] + '--=({algo})=--\n Hashed & Compared: DIFFERENT HASH' .format (algo = algo ))
151
150
152
- def do_hashes (self , _ln ):
153
- print (self .cls ['BLUE' ] + '-----[HASHES ]-----' , self .cls ['RESET' ] +
151
+ def do_algos (self , _ln ):
152
+ print (self .cls ['BLUE' ] + '-----[ALGORITHMS ]-----' , self .cls ['RESET' ] +
154
153
'Be aware that some of the algorithms like MD5 and SHA-1 are not '
155
154
'secure anymore and should never be used to hash valuable data. '
156
- 'An algorithm such as BCrypt defaultly only supports strings of max '
157
- '72 bytes long, therefore we must encrypt the text with another hash (SHA256 in this example ) '
155
+ 'An algorithm such as bcrypt defaultly only supports strings of max '
156
+ '72 bytes long, therefore we must encrypt the text with another hash (SHA256 in this instance ) '
158
157
'to implement support for longer strings.' , self .cls ['CYAN' ] +
159
- 'Hashes : ' + self .cls ['RESET' ] + 'SHA-256, SHA-512, BLAKE2b, bcrypt, scrypt, MD5, SHA-1' , sep = '\n ' , end = '\n \n ' )
158
+ 'Algorithms : ' + self .cls ['RESET' ] + 'SHA-256, SHA-512, BLAKE2b, bcrypt, scrypt, MD5, SHA-1' , sep = '\n ' , end = '\n \n ' )
160
159
161
160
def default (self , ln ):
162
161
ln = ln .lower ()
0 commit comments