Refactored existing code and added support for symmetric encryption.

Will print out exactly the following, right?