Refactored existing code and added support for symmetric encryption.

change to "Authenticated Encryption"?