yamuna mathew
yamuna mathew

Reputation: 1079

How to encrypt and decrypt xml using openSSL with public key

Can any one able to tell me how to encrypt and decrypt a xml file using openssl. I can able to create privatekey using the Linux command

openssl genrsa -out private.pem 1024 

And got my private key as private.pem. Created public key using

openssl rsa -in private.pem -out public.pem -outform PEM -pubout

got my public key as public.pem

Now what I want is I want to encrypt the XML file using this public key and again want to decrypt using my private key.

Upvotes: 0

Views: 4082

Answers (1)

trojanfoe
trojanfoe

Reputation: 122381

Try:

$ openssl rsautl -encrypt -inkey public.pem -pubin -in file.xml -out file.xml.encrypted

Hint: I cheated and looked here:

http://www.devco.net/archives/2006/02/13/public_-_private_key_encryption_using_openssl.php

Upvotes: 2

Related Questions