教学服务系统

 找回密码
 立即注册
搜索
查看: 599|回复: 0

信息计算2019级1班18号冯雨

[复制链接]

11

主题

17

帖子

83

积分

注册会员

Rank: 2

积分
83
发表于 2022-4-16 17:58:40 | 显示全部楼层 |阅读模式
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Security.Cryptography;
  6. using System.Text;
  7. using System.Threading.Tasks;

  8. namespace ConsoleApp1
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string key = "01020304";
  15.             TripleDES_ tripleDES_01 = new TripleDES_(key);
  16.             Console.WriteLine("需要加密的文件:");
  17.             string inFile = @"C:\Users\Lenovo\Desktop" + Console.ReadLine() + ".txt";
  18.             Console.WriteLine("加密后的文件:");
  19.             string miFile = @"C:\Users\Lenovo\Desktop" + Console.ReadLine() + ".txt";
  20.             tripleDES_01.Encrypt(inFile, miFile);
  21.              Console.WriteLine("解密后的文件:");
  22.             string outFile = @"C:\Users\Lenovo\Desktop" + Console.ReadLine() + ".txt";
  23.             tripleDES_01.Decrypt(miFile, outFile);
  24.         }
  25.     }
复制代码




现在桌面上建立一个01文本文件,然后调用TripleDES_类里的Encrypt方法对文件加密,再通过Decrypt方法对文件解密。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

教学服务系统

GMT+8, 2025-4-30 07:32 , Processed in 0.015419 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表