I took down this Gist due to concerns about the security of the encryption/decryption part of this code (see comments below).
Rob Napier (@rnapier) has created a publicly available class that provides similar AES encryption/decryption functionality at https://github.com/rnapier/RNCryptor.
The only thing 'dangerous' about this code (from my point of view) is, that's it's using a symmetric-key algorithm (AES).
If, in your use case, you don't let users enter a password that is used as the symmetric key the creation/storage of the symmetric key is problematic. See http://en.wikipedia.org/wiki/Symmetric_encryption for more details. Use public-key cryptography whenever applicable.