Added encryption to serialisation