def gen_pubpriv_keys(nbits):
 (p, q, e, d) = gen_keys(nbits)
 return ({'e': e, 'n': (p * q)}, {'d': d, 'p': p, 'q': q})

def gen_pubpriv_keys ( nbits ) : ( p , q , e , d ) = gen_keys ( nbits ) return ( { 'e' : e , 'n' : ( p * q ) } , { 'd' : d , 'p' : p , 'q' : q } )
generates public and private keys .