资源简介
DES加解密演算法.rar

代码片段和文件信息
#include
#include
#define key 3000 /* 64-bit Key */
#define iv 3000
static int m[4000][8]b[500][64]count;
static int L[32]R[32]K[16][48]F[32];
//input
void convert_in() /* Convert characters */
{ FILE *pi; /* to “0“ and “1“ bit */
int ijxp; /* stream by ASCII */
pi=fopen(“plaintext for Test.dat““r“);
count=0;
x=1;
while (x!=EOF)
{ x=fgetc(pi);
putchar(x); /* Get the plaintext */
p=1;
for (i=0;i<=7;i++)
{ m[count][i]=x & p; /* Each character */
p=p*2; /* contains 8 bits */
if (m[count][i]!=0)
m[count][i]=1;
b[count/8][8*(count%8)+i]=m[count][i]; /* Each block contains */
} /* 8 characters=64 bits*/
count+=1;
}
count=count-2;
while ((count%8)!= 0) /* Append “space“: padding */
{ for (i=0;i<=7;i++) /* character to obtain */
b[count/8][8*(count%8)+i]=0; /* a complete block */
b[count/8][8*(count%8)+5]=1;
count+=1;
}
fclose(pi);
}
//output
void convert_out() /* Convert “0“ and “1“ */
{ /* bit stream to */
int ixpjna; /* characters */
for (i=0;i for (j=0;j<=7;j++)
for (n=0;n<=7;n++)
m[i*8+j][n]=b[i][j*8+n];
for (i=0;i { p=1;
x=0;
for (j=0;j<=7;j++) /* Convert binary to decimal int */
{ a=m[i][j]*p;
p=p*2;
x=x+a;
}
putchar(x); /* Output the ciphertext */
}
printf(“\n“);
}
//IP
void IP(sT) /* Initial permutation and*/
int sT[64]; /* inverse permutation */
{ int ia[64]P[64];
FILE *pi;
if (s==1)
pi=fopen(“IP.dat““r“); /* Initial permutation */
if (s==-1) /* table and inverse */
pi=fopen(“IP_inv.dat““r“); /* initial permutation */
/* table */
for (i=0;i<=63;i++)
{ fscanf(pi“%d“&P[i]);
a[i]=T[i];
//printf(“%d \n“P[i]);
}
for (i=0;i<=63;i++)
T[i]=a[P[i]-1];
//printf(“%d \n“T[i]);
fclose(pi);
}
//Round F
void f(RT) /* Function f(RiKi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9039 2017-05-12 18:51 DES 加解密演算法\CBC.c
文件 140433 2017-05-12 18:51 DES 加解密演算法\CBC.exe
文件 8559 2017-05-12 18:40 DES 加解密演算法\CFB.c
文件 139409 2017-05-12 18:41 DES 加解密演算法\CFB.exe
文件 8612 2017-05-12 19:09 DES 加解密演算法\CTR.c
文件 139409 2017-05-12 19:16 DES 加解密演算法\CTR.exe
文件 130 1998-11-23 23:08 DES 加解密演算法\E.dat
文件 8427 2017-05-12 18:18 DES 加解密演算法\ENDES.c
文件 138897 2017-05-12 18:19 DES 加解密演算法\ENDES.exe
文件 185 1998-11-23 23:08 DES 加解密演算法\IP.dat
文件 184 1998-11-23 23:08 DES 加解密演算法\IP_inv.dat
文件 32 1998-11-23 23:08 DES 加解密演算法\keyshift.dat
文件 8557 2017-05-12 19:07 DES 加解密演算法\OFB.c
文件 139409 2017-05-12 19:07 DES 加解密演算法\OFB.exe
文件 87 1998-11-23 23:08 DES 加解密演算法\P.dat
文件 161 1998-11-23 23:08 DES 加解密演算法\PC_1.dat
文件 136 1998-11-23 23:08 DES 加解密演算法\PC_2.dat
文件 784 1998-11-23 23:08 DES 加解密演算法\plaintext for Test.dat
文件 1544 1998-11-23 23:08 DES 加解密演算法\sbox.dat
目录 0 2019-02-06 22:44 DES 加解密演算法
----------- --------- ---------- ----- ----
743994 20
- 上一篇:四种决策准则 悲观 乐观 后悔值
- 下一篇:编译原理作业-表达式编译器
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论