0

I have a file( simple.txt) and I generated public key and private key using openssl showed below

openssl genrsa -out key_pair.key 2048
private key :
openssl pkcs8 -topk8 -inform PEM -in key_pair.key -outform PEM -nocrypt -out
private_key.pem
publice key :
openssl rsa -in key_pair.key -pubout -outform PEM -out public_key.pem

now I want to encrypt and sign my file using this public and private key and send it to another person and then he can decrypt and check the signature that this file sent by me .mention that I don't want to generate public and private keys using RSA and I want to address my generated keys showed above .how can i use python to encrypt my file ?

Ali farahzadi
  • 274
  • 2
  • 10

1 Answers1

1

Possible duplicate of Encrypting a file with RSA in Python check this site fo reference https://www.geeksforgeeks.org/how-to-encrypt-and-decrypt-strings-in-python/

The_napkin
  • 24
  • 4