Convert RSA public key and private key to PEM format:

$ openssl rsa -in ~/.ssh/id_rsa -outform pem > 

$ openssl rsa -in ~/.ssh/id_rsa -pubout -outform pem >

Encrypting a file with your public key:

$ openssl rsautl -encrypt -pubin -inkey \
-in file.txt -out file.enc

Decrypting the file with your private key:

$ openssl rsautl -decrypt -inkey id_rsa.pem \
-in file.enc -out file.txt

Of course, this is asymmetric encryption and your file must be less than or equal in size to your key!