Exemplo n.º 1
0
        public static void WriteAllBytes(string path, byte[] bytes, string key, string iv)
        {
            var bs = DESUtil.Encrypt(bytes, key, iv);

            File.WriteAllBytes(path, bs);
        }
Exemplo n.º 2
0
        public static void WriteAllText(string path, string text, string key, string iv)
        {
            var bs = DESUtil.Encrypt(text, key, iv);

            File.WriteAllText(path, bs);
        }
Exemplo n.º 3
0
        public static byte[] ReadAllBytes(string path, string key, string iv)
        {
            var text = File.ReadAllBytes(path);

            return(DESUtil.Decrypt(text, key, iv));
        }
Exemplo n.º 4
0
        public static string ReadAllText(string path, string key, string iv)
        {
            var text = File.ReadAllText(path);

            return(DESUtil.Decrypt(text, key, iv));
        }