Refactored existing code and added support for symmetric encryption.

Can haz package comment?