Added encryption with functioning authentication.