Trying to encrypt a text message via command line on OSX Yosomite 10.10.2
Created public .pem
key like this:
ssh-keygen -f ~/.ssh/id_rsa.pub -e -t PKCS8 > id_rsa.pem
If I try to encrypt myMessage.txt
openssl rsautl -encrypt -inkey ~/.ssh/id_rsa.pem -pubin -in ~/Desktop/myMessage.txt -out ~/Desktop/encrypted.txt
I get unable to load Public key
If I then type:
openssl asn1parse -in id_rsa.pem
Returns: Error: offset too large
But I have no idea how to fix it. What should I change to make it work?