0

I have a question regarding the public key encryption. I have the public key of X and want to encrypt the message in the file message.txt using the public key of X stored in the file X.pub using openssl. I'm currently using virtualbox. I'm not sure how to import the public key of X. Any help is much appreciated.

Thanks.

1 Answers1

0

I guess you have messed with your ssh public key. If I am not wrong, regenerates it as PEM :

 openssl rsa -in <your ssh private key> -pubout -out X.pub.pem

and then encode your message with this public key :

openssl rsautl -in message.txt -out encmessage.txt -pubin -inkey X.pub.pem -encrypt
Chris
  • 66
  • 2