Let encrypt throw exceptions and handle them in its caller

* Add a docstring about the exceptions that can be thrown