Refactored existing code and added support for symmetric encryption.

While you're here, can you fix this Error call? Error -> Errorf and add %v at the end of the string.