# generate a 2048-bit RSA key and store it in private.key
openssl genrsa -out private.key 2048
# encrypt "hello world" using the RSA key in key.txt
echo "hello world" | openssl rsautl -inkey private.key -encrypt >output.bin
# decrypt the message and output to stdout
openssl rsautl -inkey private.key -decrypt <output.bin