from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA

message = b'Do zaszyfrowania'
key = RSA.importKey(open('klucz_publiczny.pem').read())
cipher = PKCS1_OAEP.new(key)
ciphertext = cipher.encrypt(message)

print(ciphertext)

key = RSA.importKey(open('klucz_prywatny.pem').read())
cipher = PKCS1_OAEP.new(key)
plaintext = cipher.decrypt(ciphertext)

print()
print(plaintext)