教学服务系统

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

信息计算2019级2班16号吴盛盛

[复制链接]

8

主题

17

帖子

134

积分

注册会员

Rank: 2

积分
134
发表于 2022-4-16 10:35:06 | 显示全部楼层 |阅读模式
本帖最后由 吴盛盛 于 2022-4-16 10:38 编辑
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Security.Cryptography;
  5. using System.Text;
  6. using System.Threading.Tasks;

  7. namespace t3des
  8. {   
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string key = "qwertyuiop1234567890";
  14.             string inFile1 = @"C:\Users\xiaofan\Desktop\text1.txt";
  15.             string outFile1 = @"C:\Users\xiaofan\Desktop\text2.txt";
  16.             string inFile2 = @"C:\Users\xiaofan\Desktop\text2.txt";
  17.             string outFile2 = @"C:\Users\xiaofan\Desktop\text3.txt";
  18.             TripleDES_ my3des = new TripleDES_(key);
  19.             my3des.Encrypt(inFile1, outFile1);
  20.             my3des.Decrypt(inFile2, outFile2);
  21.         }
  22.     }
  23. }
复制代码
运行结果待加密文件

待解密文件

已解密文件


思路
1.创建三个文本文件;
2.引用类TripleDES_ ;
3.调用类TripleDES_里的方法Encrypt和Decrypt,对待加密的文件进行加密和解密;








本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

教学服务系统

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

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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