How can I JSON encode a table, encrypt it, save it, and restore it?

Did you try to decrypt data ? Because I think I get error in that part.