def PassphraseCallback(verify=False, prompt1='Enter passphrase:', prompt2='Verify passphrase:'):
 while 1:
  try:
   p1 = getpass.getpass(prompt1)
   if verify:
    p2 = getpass.getpass(prompt2)
    if (p1 == p2):
     break
   else:
    break
  except KeyboardInterrupt:
   return None
 return p1

def PassphraseCallback ( verify = False , prompt1 = 'Enter passphrase:' , prompt2 = 'Verify passphrase:' ) : while 1 : try : p1 = getpass . getpass ( prompt1 ) if verify : p2 = getpass . getpass ( prompt2 ) if ( p1 == p2 ) : break else : break except KeyboardInterrupt : return None return p1
a utility function to read a passphrase from stdin .