Added function to serialize, encrypt and save also maps and json files