xxxxxxxxxx
Import rsa library.
Generate public and private keys with rsa.
Encode the string to byte string.
Then encrypt the byte string with the public key.
Then the encrypted string can be decrypted with the private key.
The public key can only be used for encryption and the private can only be used for decryption.