def encrypt_master_key(master_key, public_key):
 key = RSA.importKey(public_key)
 cipher = PKCS1_OAEP.new(key)
 return cipher.encrypt(master_key)

def encrypt_master_key ( master_key , public_key ) : key = RSA . importKey ( public_key ) cipher = PKCS1_OAEP . new ( key ) return cipher . encrypt ( master_key )
encrypt a secret key with the provided public rsa key .