Add secured pickling inspired by n2o