https://docs.godotengine.org/en/3.1/tutorials/io/encrypting_save_games.html
The docs here are a bit to short and not broad enough to be of help. Here they just use the storevar function in File, but what if I want to encrypt a ConfigFile and use setvalue()?. Tried to apply the same technique directly, but it doesn't seem to work:
var save_path = "res://SaveFile.cfg"
var config = ConfigFile.new()
var load_respone = config.load(save_path)
var file = File.new()
func saveValue(section, key, value):
file.open_encrypted_with_pass(save_path, File.WRITE, "mypass")
config.set_value(section, key, value)
config.save(save_path)
file.close()
func loadValue(section, key):
file.open_encrypted_with_pass(save_path, File.READ, "mypass")
return config.get_value(section, key, 0)
file.close()