Fixed encryption/decryption of json objects