我下载了DES算法源程序,可不知怎么用,哪位指点一二,先谢了。

thp 2003-12-08 01:05:13
如题
...全文
101 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
thp 2003-12-12
  • 打赏
  • 举报
回复
错误:
Build
[Linker Error] Unresolved external 'des(unsigned char *, unsigned char *)' referenced from E:\WORK\DES_TEST\UMAIN.OBJ
thp 2003-12-12
  • 打赏
  • 举报
回复
/* d3des.h -
*
* Headers and defines for d3des.c
* Graven Imagery, 1992.
*
* Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge
* (GEnie : OUTER; CIS : [71755,204])
*/

#define D2_DES /* include double-length support */
#define D3_DES /* include triple-length support */

#ifdef D3_DES
#ifndef D2_DES
#define D2_DES /* D2_DES is needed for D3_DES */
#endif
#endif

#define EN0 0 /* MODE == encrypt */
#define DE1 1 /* MODE == decrypt */

/* A useful alias on 68000-ish machines, but NOT USED HERE. */

typedef union {
unsigned long blok[2];
unsigned short word[4];
unsigned char byte[8];
} M68K;

extern void deskey(unsigned char *, short);
/* hexkey[8] MODE
* Sets the internal key register according to the hexadecimal
* key contained in the 8 bytes of hexkey, according to the DES,
* for encryption or decryption according to MODE.
*/

extern void usekey(unsigned long *);
/* cookedkey[32]
* Loads the internal key register with the data in cookedkey.
*/

extern void cpkey(unsigned long *);
/* cookedkey[32]
* Copies the contents of the internal key register into the storage
* located at &cookedkey[0].
*/

extern void des(unsigned char *, unsigned char *);
/* from[8] to[8]
* Encrypts/Decrypts (according to the key currently loaded in the
* internal key register) one block of eight bytes at address 'from'
* into the block at address 'to'. They can be the same.
*/

#ifdef D2_DES

#define desDkey(a,b) des2key((a),(b))
extern void des2key(unsigned char *, short);
/* hexkey[16] MODE
* Sets the internal key registerS according to the hexadecimal
* keyS contained in the 16 bytes of hexkey, according to the DES,
* for DOUBLE encryption or decryption according to MODE.
* NOTE: this clobbers all three key registers!
*/

extern void Ddes(unsigned char *, unsigned char *);
/* from[8] to[8]
* Encrypts/Decrypts (according to the keyS currently loaded in the
* internal key registerS) one block of eight bytes at address 'from'
* into the block at address 'to'. They can be the same.
*/

extern void D2des(unsigned char *, unsigned char *);
/* from[16] to[16]
* Encrypts/Decrypts (according to the keyS currently loaded in the
* internal key registerS) one block of SIXTEEN bytes at address 'from'
* into the block at address 'to'. They can be the same.
*/

extern void makekey(char *, unsigned char *);
/* *password, single-length key[8]
* With a double-length default key, this routine hashes a NULL-terminated
* string into an eight-byte random-looking key, suitable for use with the
* deskey() routine.
*/

#define makeDkey(a,b) make2key((a),(b))
extern void make2key(char *, unsigned char *);
/* *password, double-length key[16]
* With a double-length default key, this routine hashes a NULL-terminated
* string into a sixteen-byte random-looking key, suitable for use with the
* des2key() routine.
*/

#ifndef D3_DES /* D2_DES only */

#define useDkey(a) use2key((a))
#define cpDkey(a) cp2key((a))

extern void use2key(unsigned long *);
/* cookedkey[64]
* Loads the internal key registerS with the data in cookedkey.
* NOTE: this clobbers all three key registers!
*/

extern void cp2key(unsigned long *);
/* cookedkey[64]
* Copies the contents of the internal key registerS into the storage
* located at &cookedkey[0].
*/

#else /* D3_DES too */

#define useDkey(a) use3key((a))
#define cpDkey(a) cp3key((a))

extern void des3key(unsigned char *, short);
/* hexkey[24] MODE
* Sets the internal key registerS according to the hexadecimal
* keyS contained in the 24 bytes of hexkey, according to the DES,
* for DOUBLE encryption or decryption according to MODE.
*/

extern void use3key(unsigned long *);
/* cookedkey[96]
* Loads the 3 internal key registerS with the data in cookedkey.
*/

extern void cp3key(unsigned long *);
/* cookedkey[96]
* Copies the contents of the 3 internal key registerS into the storage
* located at &cookedkey[0].
*/

extern void make3key(char *, unsigned char *);
/* *password, triple-length key[24]
* With a triple-length default key, this routine hashes a NULL-terminated
* string into a twenty-four-byte random-looking key, suitable for use with
* the des3key() routine.
*/

#endif /* D3_DES */
#endif /* D2_DES */

/* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery
********************************************************************/



头文件贴出来了,大伙帮忙看一下,应该怎么用呀????
叶子哟 2003-12-09
  • 打赏
  • 举报
回复
http://www.chinabcb.com/bbs/viewtopic.php?t=8400&highlight=des
叶子哟 2003-12-09
  • 打赏
  • 举报
回复
http://www.chinabcb.com/bbs/viewtopic.php?t=8399&highlight=des
xjcpower 2003-12-09
  • 打赏
  • 举报
回复
gz!
不知楼主能否分享你下载的那个东东?
my email:htzxkj_4@sina.com
多谢多谢!
KingOf007 2003-12-09
  • 打赏
  • 举报
回复
有输入,有输出,把明文和密码扔进去,出来密文,把密文和密码扔进去,出来明文:P
thp 2003-12-09
  • 打赏
  • 举报
回复
文档是E文的,看了个大概意思。
代码是C写的,就几个函数而已。

算了,我自己试一下好了。
TopCat 2003-12-08
  • 打赏
  • 举报
回复
你这种问题属于 无法回答 的那种。

* 你从哪儿下载的源代码?
* 有说明文档吗?
* 代码你看了没?都有些什么?

起码的东西该告诉我们吧。
thp 2003-12-08
  • 打赏
  • 举报
回复
.

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧