我自己作的一个系统,该系统的用户ID和密码都存在一个文件里,有没有现成的加密
函数可以用对ID和密码进行简单的加密,最后有源代码可以之间用,分没问题,可以
倾囊相送,请高手指点
---------------------------------------------------------------
到“数据结构和算法”区或者在网上搜一下,这应该很好找的。
---------------------------------------------------------------
用系统的crypt就行乐!详细请man 3 crypt
---------------------------------------------------------------
up
---------------------------------------------------------------
crypt encrypt or setkey Subroutine
char *crypt (PW, Salt)
const char * PW, * Salt;
void encrypt (Block, EdFlag)
char Block[64];
int EdFlag;
void setkey (Key)
const char * Key;
If you need to statically bind functions from libc.a for crypt do the following:
1. Create a file and add the following:
#!
___setkey
___encrypt
___crypt
2. Perform the linking.
3. Add the following to the make file:
-bI:YourFileName
where YourFileName is the name of the file you created in step 1. It should
look like the following:
LDFLAGS=bnoautoimp -bI:/lib/syscalls.exp -bI:YourFileName -lc