encrypts to json str