mirror of
https://github.com/ComradCollective/Comrad
synced 2024-11-11 13:10:45 +00:00
updates
This commit is contained in:
parent
72d6821556
commit
97d05f8580
@ -289,10 +289,10 @@ class CLI(Logger):
|
||||
)
|
||||
|
||||
s0=str.center('[Encryption Process]',CLI_WIDTH)
|
||||
s1=s0 + '\n\n' + self.print('Now that we have (2A), we can use it to encrypt the super-sensitive private key (2):',ret=True)
|
||||
s2a = self.print(f"(2A) {make_key_discreet_str(passphrase)}",ret=True)
|
||||
s2 = self.print(f"(2) {make_key_discreet(privkey.data_b64)}",ret=True)
|
||||
s2b = self.print(f"(2B) {make_key_discreet(b64encode(privkey_encr))}",ret=True)
|
||||
s1=s0 + '\n\n' + self.printt('Now that we have (2A), we can use it to encrypt the super-sensitive private key (2):',ret=True)
|
||||
s2a = self.printt(f"(2A) {make_key_discreet_str(passphrase)}",ret=True)
|
||||
s2 = self.printt(f"(2) {make_key_discreet(privkey.data_b64)}",ret=True)
|
||||
s2b = self.printt(f"(2B) {make_key_discreet(b64encode(privkey_encr))}",ret=True)
|
||||
self.status(
|
||||
# screen 1
|
||||
None,{f'{s1}'},
|
||||
@ -315,7 +315,7 @@ class CLI(Logger):
|
||||
)
|
||||
|
||||
|
||||
shdr=str.center('[Decryption Process]',CLI_WIDTH) + '\n\n' + self.print('Once we have (2B), we don\'t need (2A) or (2) anymore. We can regenerate them!',ret=True)
|
||||
shdr=str.center('[Decryption Process]',CLI_WIDTH) + '\n\n' + self.printt('Once we have (2B), we don\'t need (2A) or (2) anymore. We can regenerate them!',ret=True)
|
||||
from getpass import getpass
|
||||
|
||||
passhash = None
|
||||
@ -324,7 +324,7 @@ class CLI(Logger):
|
||||
res = self.status(
|
||||
None,{shdr},False if passhash is None else True,
|
||||
|
||||
("pass",self.print(f"Let's try. Re-type your password into @Hasher:",ret=True)+f" \n ",getpass)
|
||||
("pass",self.printt(f"Let's try. Re-type your password into @Hasher:",ret=True)+f" \n ",getpass)
|
||||
)
|
||||
|
||||
passhash = self.persona.crypt_keys.hash(res.get('vals').get('pass').encode())
|
||||
|
@ -288,10 +288,10 @@ class CLI(Logger):
|
||||
)
|
||||
|
||||
s0=str.center('[Encryption Process]',CLI_WIDTH)
|
||||
s1=s0 + '\n\n' + self.print('Now that we have (2A), we can use it to encrypt the super-sensitive private key (2):',ret=True)
|
||||
s2a = self.print(f"(2A) {make_key_discreet_str(passphrase)}",ret=True)
|
||||
s2 = self.print(f"(2) {make_key_discreet(privkey.data_b64)}",ret=True)
|
||||
s2b = self.print(f"(2B) {make_key_discreet(b64encode(privkey_encr))}",ret=True)
|
||||
s1=s0 + '\n\n' + self.printt('Now that we have (2A), we can use it to encrypt the super-sensitive private key (2):',ret=True)
|
||||
s2a = self.printt(f"(2A) {make_key_discreet_str(passphrase)}",ret=True)
|
||||
s2 = self.printt(f"(2) {make_key_discreet(privkey.data_b64)}",ret=True)
|
||||
s2b = self.printt(f"(2B) {make_key_discreet(b64encode(privkey_encr))}",ret=True)
|
||||
self.status(
|
||||
# screen 1
|
||||
None,{f'{s1}'},
|
||||
@ -314,7 +314,7 @@ class CLI(Logger):
|
||||
)
|
||||
|
||||
|
||||
shdr=str.center('[Decryption Process]',CLI_WIDTH) + '\n\n' + self.print('Once we have (2B), we don\'t need (2A) or (2) anymore. We can regenerate them!',ret=True)
|
||||
shdr=str.center('[Decryption Process]',CLI_WIDTH) + '\n\n' + self.printt('Once we have (2B), we don\'t need (2A) or (2) anymore. We can regenerate them!',ret=True)
|
||||
from getpass import getpass
|
||||
|
||||
passhash = None
|
||||
@ -323,7 +323,7 @@ class CLI(Logger):
|
||||
res = self.status(
|
||||
None,{shdr},False if passhash is None else True,
|
||||
|
||||
("pass",self.print(f"Let's try. Re-type your password into @Hasher:",ret=True)+f" \n ",getpass)
|
||||
("pass",self.printt(f"Let's try. Re-type your password into @Hasher:",ret=True)+f" \n ",getpass)
|
||||
)
|
||||
|
||||
passhash = self.persona.crypt_keys.hash(res.get('vals').get('pass').encode())
|
||||
|
@ -354,10 +354,10 @@ class CLI(Logger):
|
||||
)
|
||||
|
||||
s0=str.center('[Encryption Process]',CLI_WIDTH)
|
||||
s1=s0 + '\n\n' + self.print('Now that we have (2A), we can use it to encrypt the super-sensitive private key (2):',ret=True)
|
||||
s2a = self.print(f"(2A) {make_key_discreet_str(passphrase)}",ret=True)
|
||||
s2 = self.print(f"(2) {make_key_discreet(privkey.data_b64)}",ret=True)
|
||||
s2b = self.print(f"(2B) {make_key_discreet(b64encode(privkey_encr))}",ret=True)
|
||||
s1=s0 + '\n\n' + self.printt('Now that we have (2A), we can use it to encrypt the super-sensitive private key (2):',ret=True)
|
||||
s2a = self.printt(f"(2A) {make_key_discreet_str(passphrase)}",ret=True)
|
||||
s2 = self.printt(f"(2) {make_key_discreet(privkey.data_b64)}",ret=True)
|
||||
s2b = self.printt(f"(2B) {make_key_discreet(b64encode(privkey_encr))}",ret=True)
|
||||
self.status(
|
||||
# screen 1
|
||||
None,{f'{s1}'},
|
||||
@ -380,7 +380,7 @@ class CLI(Logger):
|
||||
)
|
||||
|
||||
|
||||
shdr=str.center('[Decryption Process]',CLI_WIDTH) + '\n\n' + self.print('Once we have (2B), we don\'t need (2A) or (2) anymore. We can regenerate them!',ret=True)
|
||||
shdr=str.center('[Decryption Process]',CLI_WIDTH) + '\n\n' + self.printt('Once we have (2B), we don\'t need (2A) or (2) anymore. We can regenerate them!',ret=True)
|
||||
from getpass import getpass
|
||||
|
||||
passhash = None
|
||||
@ -389,7 +389,7 @@ class CLI(Logger):
|
||||
res = self.status(
|
||||
None,{shdr},False if passhash is None else True,
|
||||
|
||||
("pass",self.print(f"Let's try. Re-type your password into @Hasher:",ret=True)+f" \n ",getpass)
|
||||
("pass",self.printt(f"Let's try. Re-type your password into @Hasher:",ret=True)+f" \n ",getpass)
|
||||
)
|
||||
|
||||
passhash = self.persona.crypt_keys.hash(res.get('vals').get('pass').encode())
|
||||
|
@ -75,7 +75,7 @@ class Logger(object):
|
||||
# except KeyboardInterrupt:
|
||||
# exit()
|
||||
|
||||
def print(*x,width=STATUS_LINE_WIDTH,end='\n',indent=1,ret=False,scan=False,**y):
|
||||
def printt(*x,width=STATUS_LINE_WIDTH,end='\n',indent=1,ret=False,scan=False,**y):
|
||||
if not scan and not width:
|
||||
print(*x,end=end,**y)
|
||||
else:
|
||||
@ -135,11 +135,11 @@ class Logger(object):
|
||||
elif type(para) is dict:
|
||||
print(dict_format(para,tab=tab))
|
||||
elif pause:
|
||||
self.print(para,flush=True,end=end if end else '\n',scan=scan,indent=indent)
|
||||
self.printt(para,flush=True,end=end if end else '\n',scan=scan,indent=indent)
|
||||
paras+=[para]
|
||||
do_pause()
|
||||
else:
|
||||
self.print(para,flush=True,end=end if end else '\n',scan=scan,indent=indent)
|
||||
self.printt(para,flush=True,end=end if end else '\n',scan=scan,indent=indent)
|
||||
paras+=[para]
|
||||
return {'paras':paras, 'vals':res}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user