Refactored existing code and added support for symmetric encryption.

There is a package comment in `secret.go`?