phpSec is a PHP5 library that provides you as a developer with a set of commonly (and some that should be) used methods, protecting your application against various attacks. XSS filter. CSRF protection. Password hashing helper functions. Logging functions. Data encryption. Enhanced session security. Session encryption. Random data generator.