Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use getpass to avoid echoing the password input #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
bls_priv_to_pub,
)
from utils.crypto import SHA256

import getpass

def get_args():
parser = ArgumentParser(description='🦄 : the validator deposit assistant')
Expand Down Expand Up @@ -58,12 +58,12 @@ def calculate_credentials(mnemonic: str, password: str, num_validators: int) ->

def save_keystores(credentials: List[Dict[str, Union[int, str]]], folder: str='./', save_withdrawal_keys: bool=False):
def save_credentials(cred_type: 'str'):
password = input('Enter the password that secures your %s keys.' % cred_type)
confirm_password = input('Type your password again to confirm.')
password = getpass.getpass(prompt='Enter the password that secures your %s keys.' % cred_type)
confirm_password = getpass.getpass(prompt='Type your password again to confirm.')
while password != confirm_password:
print("\n Your passwords didn't match, please try again.\n")
password = input('Enter the password that secures your %s keys.' % cred_type)
confirm_password = input('Type your password again to confirm.')
password = getpass.getpass(prompt='Enter the password that secures your %s keys.' % cred_type)
confirm_password = getpass.getpass(prompt='Type your password again to confirm.')
for credential in credentials:
keystore = ScryptKeystore.encrypt(secret=int(credential['%s_sk' % cred_type]).to_bytes(32, 'big'),
password=password, path=str(credential['%s_path' % cred_type]))
Expand Down