Refactored existing code and added support for symmetric encryption.

docs/secret.rst is empty right now