While looking for something to help php connect to a sftp server I stumbled across libphpsec which is a fantastic library that has no dependencies and works in all versions of php. The documentation takes a "cookbook" approch which works really well for me.
The real genius to this library is it makes no assumptions about your environment.
If a suitable native function doesn't exist, there is a pure php one to pick up the slack.
The following are implemented in pure php:
Symmetric key encryption
I'm amazed that someone loved this problem enough to do this much work on it and thankful he chose to open-source it.
Terrafrost, if your ever able to make it to the Austin PHP Beverage Subgroup; (4th Wednesday) the drinks are on me guy.