public static void WriteAllBytes(string path, byte[] content, bool encrypt = true) { if (!encrypt) { File.WriteAllBytes(path, content); return; } string line = MUtil.ByteArrayToString(content); content = MCrypt.EncryptString(line); File.WriteAllBytes(path, content); }
public static void WriteAllText(string path, string content, bool encrypt = true) { if (!encrypt) { File.WriteAllText(path, content); return; } byte[] encrypted = MCrypt.EncryptString(content); //File.WriteAllBytes(path, encrypted); //string text = MUtil.ByteArrayToString(encrypted); //File.WriteAllText(path, text); File.WriteAllBytes(path, encrypted); }