资源简介
DES文件加密传输
通过把数据进行MD5加密,加密后的MD5码再进行DES数据加密,然后通过文件结构信息把加密后的DES信息进行传输,在接收端把获得的文件再进行加密然后与文件结构信息的加密码进行比对。
代码片段和文件信息
#include “stdafx.h“
#include
#include
#include
#include
#include
#include “md5.h“
/* POINTER defines a generic pointer type */
typedef unsigned char *POINTER;
/* UINT2 defines a two byte word */
typedef unsigned short int UINT2;
/* UINT4 defines a four byte word */
typedef unsigned long int UINT4;
#define PROTO_LIST(list) list
/* MD5 context. */
typedef struct _MD5_CTX
{
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;
/* Constants for MD5Transform routine.
*/
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21
static unsigned char PADDING[64] = {
0x80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
};
/* F G H and I are basic MD5 functions.
*/
#define F(x y z) (((x) & (y)) | ((~x) & (z)))
#define G(x y z) (((x) & (z)) | ((y) & (~z)))
#define H(x y z) ((x) ^ (y) ^ (z))
#define I(x y z) ((y) ^ ((x) | (~z)))
/* ROTATE_LEFT rotates x left n bits.
*/
#define ROTATE_LEFT(x n) (((x) << (n)) | ((x) >> (32-(n))))
/* FF GG HH and II transformations for rounds 1 2 3 and 4.
Rotation is separate from addition to prevent recomputation.
*/
#define FF(a b c d x s ac) { \
(a) += F ((b) (c) (d)) + (x) + (UINT4)(ac);\
(a) = ROTATE_LEFT ((a) (s)); \
(a) += (b); \
}
#define GG(a b c d x s ac) { \
(a) += G ((b) (c) (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a) (s)); \
(a) += (b); \
}
#define HH(a b c d x s ac) { \
(a) += H ((b) (c) (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a) (s)); \
(a) += (b); \
}
#define II(a b c d x s ac) { \
(a) += I ((b) (c) (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a) (s)); \
(a) += (b); \
}
#define TEST_BLOCK_LEN 1000
#define TEST_BLOCK_COUNT 1000
static void MD5Transform PROTO_LIST ((UINT4 [4] unsigned char [64]));
static void Encode PROTO_LIST ((unsigned char * UINT4 * unsigned int));
static void Decode PROTO_LIST ((UINT4 * unsigned char * unsigned int));
static void MD5_memcpy PROTO_LIST ((POINTER POINTER unsigned int));
static void MD5_memset PROTO_LIST ((POINTER int unsigned int));
static void MD5Init PROTO_LIST ((MD5_CTX *));
static void MD5Update PROTO_LIST ((MD5_CTX * unsigned char * unsigned int));
static void MD5Final PROTO_LIST ((unsigned char [16] MD5_CTX *));
static void MDTimeTrial PROTO_LIST ((void));
static void StringAddOne PROTO_LIST ((char *));
static void Encode PROTO_LIST ((unsigned char * UINT4 * unsigned int));
static void Decode PROTO_LIST ((UINT4 * unsigned c
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 74752 2004-12-25 13:18 1.Transfer_DES\source code\TransClient\Client.ncb
文件 53760 2004-12-25 13:18 1.Transfer_DES\source code\TransClient\Client.opt
文件 14354 2012-05-24 22:30 1.Transfer_DES\source code\TransClient\Debug\md5.obj
文件 0 2012-05-24 22:30 1.Transfer_DES\source code\TransClient\Debug\md5.sbr
文件 26196 2012-05-25 00:10 1.Transfer_DES\source code\TransClient\Debug\schedle.obj
文件 0 2012-05-25 00:10 1.Transfer_DES\source code\TransClient\Debug\schedle.sbr
文件 106746 2012-05-23 18:02 1.Transfer_DES\source code\TransClient\Debug\StdAfx.obj
文件 1391540 2012-05-23 18:02 1.Transfer_DES\source code\TransClient\Debug\StdAfx.sbr
文件 5440512 2012-05-25 10:24 1.Transfer_DES\source code\TransClient\Debug\TransClient.bsc
文件 127065 2012-05-25 10:24 1.Transfer_DES\source code\TransClient\Debug\TransClient.exe
文件 285744 2012-05-25 10:24 1.Transfer_DES\source code\TransClient\Debug\TransClient.ilk
文件 13410 2012-05-24 20:13 1.Transfer_DES\source code\TransClient\Debug\TransClient.obj
文件 6941372 2012-05-23 18:02 1.Transfer_DES\source code\TransClient\Debug\TransClient.pch
文件 394240 2012-05-25 10:24 1.Transfer_DES\source code\TransClient\Debug\TransClient.pdb
文件 2428 2012-05-23 18:02 1.Transfer_DES\source code\TransClient\Debug\TransClient.res
文件 0 2012-05-24 20:13 1.Transfer_DES\source code\TransClient\Debug\TransClient.sbr
文件 27213 2012-05-25 10:24 1.Transfer_DES\source code\TransClient\Debug\TransClientDlg.obj
文件 0 2012-05-25 10:24 1.Transfer_DES\source code\TransClient\Debug\TransClientDlg.sbr
文件 222208 2012-05-25 10:37 1.Transfer_DES\source code\TransClient\Debug\vc60.idb
文件 364544 2012-05-25 10:24 1.Transfer_DES\source code\TransClient\Debug\vc60.pdb
文件 11386 2012-01-27 13:46 1.Transfer_DES\source code\TransClient\md5.cpp
文件 139 2007-03-31 15:02 1.Transfer_DES\source code\TransClient\md5.h
文件 3669 2004-12-25 13:32 1.Transfer_DES\source code\TransClient\ReadMe.txt
文件 1078 2006-02-23 11:16 1.Transfer_DES\source code\TransClient\res\TransClient.ico
文件 403 2004-12-25 13:32 1.Transfer_DES\source code\TransClient\res\TransClient.rc2
文件 734 2006-02-23 11:28 1.Transfer_DES\source code\TransClient\resource.h
文件 9773 2007-04-20 20:44 1.Transfer_DES\source code\TransClient\schedle.cpp
文件 977 2007-03-25 15:37 1.Transfer_DES\source code\TransClient\schedle.h
文件 932 2006-02-23 11:21 1.Transfer_DES\source code\TransClient\sf.cpp
文件 1173 2006-02-23 11:20 1.Transfer_DES\source code\TransClient\sf.h
............此处省略69个文件信息
- 上一篇:5g为人工智能与智能制造赋能.pdf
- 下一篇:多普达575刷机工具
相关资源
- 折中与优化——Tradeoffs and Optimizatio
- 国嵌 Linux 安全文件传输
- the-ultimate-guide-to-video-game-writing-and-d
- (经典原创)BrocadeSAN交换机ZONE配置
- Caltech Pedestrian Dataset 数据集seq文件解
- ZedBoard_OOB_Design(SD card image and source)
- Altium Designer下PIC单片机的集成库
- Design Compiler入门教程
- PowerDesigner建模
- Design-Expert 响应面分析软件使用教程
- altium designer9破解包
- How to Design Programs Second Edition
-
myba
se Desktop 7.3 破解补丁 亲测可用 - anylogic行人库中文说明文档
- AltiumDesigner9.4破解补丁
- Low Power Methodology Manual for Soc Design.pd
- zw_DeskClock.zip
- DES算法硬件实现
- Allegro软件--PADS软件--Altium Designer软件
- The Reasoned Schemer 2nd Edition
- R Graphics 3rd Edition
- Logic & Computer Design Fundamentals (5th Ed
- Altium Designer10制作案例
- Microcopy: The Complete Guide
- Altium designer PCB画板速成教材--郑总编
- LMIs in Control Systems: Analysis Design and A
- substance designer材质贴图学习笔记
- Altium Designer 13标准教程-周冰
- Design Compiler® User Guide Version O-2018.06
- Radio Frequency Integrated Circuit Design
评论
共有 条评论