Return error instead of panicing in Encrypt.

Change the Encrypt method to return an empty string and an error if it
detects an error instead of panicing, as is the convention in Go.

There is still a panic() call in the unhash function, but from the panic
message it seems that this may actually be an exceptional error, for
which panicing *may* be appropriate (I am not certain; I haven't taken
the time yet to fully understand what is going on in this package).
Update tests for previous change

Added some error handling code to the tests.