Refactored existing code and added support for symmetric encryption.

How about `return nonceSliceToArray(bytes)`?