I have an idea for a program and I was considering using gpg and keys/rings when I came across some useful information about how to pipe data in and out using gpg. I ended up deciding not to use gpg b/c keeping sets of keys/rings is a pain in the ass. Anyways, here's the fruit.
echo "Data to be encrypted" | gpg --encrypt -r <yourid> | gpg --decrypt -r <yourid>