You can encrypt text in / from php.
The most popular method is to use php's mcrypt module, to get more
information about the functions and how to use them look here:
http://www.php.net/manual/en/ref.mcrypt.php
The second method uses pgp (www.pgp.com) as
an external program called by a pgp encryption class made in php, to
download the class and it's documentation go here:
http://www.phpuk.org/code.php