Fixed bug when encrypting json.