Refactored existing code and added support for symmetric encryption.

`decrypted[:0]` -> `decrypted`