资源简介
自己做的一个AES加密解密算法程序,内部核心算法均为自己实现

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
namespace AES
{
class Decryption
{
private static char[] alphabet ={ ‘0‘ ‘1‘ ‘2‘ ‘3‘ ‘4‘ ‘5‘ ‘6‘ ‘7‘ ‘8‘ ‘9‘ ‘a‘ ‘b‘ ‘c‘ ‘d‘ ‘e‘ ‘f‘ };
public static int[] Getdecryption(string str int[] key)
{
int[] cipherkey = new int[16];
str = str.ToLower();
char[] ch = str.ToCharArray();
int[] cipher= new int[str.Length / 32 16];
int[] plian = new int[str.Length / 32 16];
int[] plaintext = new int[16];
StringBuilder s = new StringBuilder(100000);
for (int i = 0; i < str.Length; i++)
{
for (int j = 3; j >= 0; j--)
{
s = s.Append(Decryption.GetNum(ch[i]) >> j & 1);
}
}
for (int i = 0; i < cipher.GetLength(0); i++)
{
for (int j = 0; j < 16; j++)
cipher[i j] = Convert.ToInt32(s.ToString(j * 8 + i * 128 8) 2);
}
EncryptionForm encryForm = new EncryptionForm();
encryForm.Show();
for (int i =0; i {
for (int h = 0; h < 16; h++)
{
cipherkey[h] = key[key.GetLength(0)-1 h];
plaintext[h] = cipher[i h];
}
encryForm.SetText(“密钥:“ cipherkey);
plaintext = AddRoundKey(plaintext cipherkey);
encryForm.SetText(“InvAddRoundKey:“plaintext);
encryForm.Set();
for (int j = key.GetLength(0)-2; j>0; j--)
{
for (int h = 0; h < 16; h++)
{
cipherkey[h] = key[j h];
}
for (int h = 0; h < plaintext.Length; h++)
{
plaintext[h] = SubBytes.GetByteSub(plaintext[h]);
}
encryForm.SetText(“InvSubBytes:“ plaintext);
plaintext = InvShiftRows(plaintext);
encryForm.SetText(“InvShiftRows:“ plaintext);
plaintext = MixColumn.InvMixColumn(plaintext);
encryForm.SetText(“InvMixColumn:“ plaintext);
encryForm.SetText(“轮密钥:“ cipherkey);
plaintext = AddRoundKey(plaintext cipherkey);
encryForm.SetText(“InvAddRoundKey:“ plaintext);
encryForm.Set();
}
for (int h = 0; h < 16; h++)
{
cipherkey[h] = key[0 h];
}
for (int h = 0; h < plaintext.Length; h++)
{
plaintext[h] = SubBytes.GetByteSub(plaintext[h]);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4592 2009-10-26 18:38 AES中文\AES\AES.csproj
文件 14458 2009-10-26 18:38 AES中文\AES\AES.ico
文件 98304 2009-12-19 19:41 AES中文\AES\bin\Debug\AES.exe
文件 108032 2009-12-19 19:41 AES中文\AES\bin\Debug\AES.pdb
....... 5632 2009-10-26 18:38 AES中文\AES\bin\Debug\AES.vshost.exe
文件 516234 2009-10-26 18:38 AES中文\AES\bin\Debug\IrisSkin2.DLL
文件 15899 2009-10-26 18:38 AES中文\AES\bin\Debug\MP10.ssk
文件 4655 2009-10-26 18:38 AES中文\AES\Decryption.cs
文件 4080 2009-10-27 14:57 AES中文\AES\Encryption.cs
文件 1307 2009-10-26 18:38 AES中文\AES\EncryptionForm.cs
文件 2992 2009-10-26 18:38 AES中文\AES\EncryptionForm.Designer.cs
文件 27800 2009-10-26 18:38 AES中文\AES\EncryptionForm.resx
文件 2674 2009-10-27 14:59 AES中文\AES\KeyExpansion.cs
文件 1341 2009-10-26 18:38 AES中文\AES\KeyExpansionForm.cs
文件 2934 2009-10-26 18:38 AES中文\AES\KeyExpansionForm.Designer.cs
文件 27800 2009-10-26 18:38 AES中文\AES\KeyExpansionForm.resx
文件 11007 2009-12-19 19:41 AES中文\AES\MainForm.cs
文件 19629 2009-12-19 19:41 AES中文\AES\MainForm.Designer.cs
文件 28198 2009-12-19 19:41 AES中文\AES\MainForm.resx
文件 6164 2009-10-26 18:38 AES中文\AES\MixColumn.cs
文件 2808 2009-12-19 19:41 AES中文\AES\obj\AES.csproj.FileListAbsolute.txt
文件 1039 2009-12-19 19:41 AES中文\AES\obj\Debug\AES.csproj.GenerateResource.Cache
文件 15024 2009-10-26 18:38 AES中文\AES\obj\Debug\AES.EncryptionForm.resources
文件 98304 2009-12-19 19:41 AES中文\AES\obj\Debug\AES.exe
文件 15024 2009-10-26 18:38 AES中文\AES\obj\Debug\AES.KeyExpansionForm.resources
文件 15024 2009-12-19 19:41 AES中文\AES\obj\Debug\AES.MainForm.resources
文件 108032 2009-12-19 19:41 AES中文\AES\obj\Debug\AES.pdb
文件 180 2009-10-26 19:14 AES中文\AES\obj\Debug\AES.Properties.Resources.resources
文件 9842 2009-10-26 19:14 AES中文\AES\obj\Debug\ResolveAssemblyReference.cache
文件 465 2009-10-26 18:38 AES中文\AES\Program.cs
............此处省略23个文件信息
- 上一篇:RDLC动态生成官方
- 下一篇:C#五子棋源代码wuziqi
相关资源
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
评论
共有 条评论