chuyiwen_gmsv/include/des.h

23 lines
985 B
C
Raw Normal View History

2016-12-24 08:45:52 +08:00
//////////////////////////////////////////////////////////////////////////
/*
Provided by <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, Northeastern University (www.neu.edu.cn)
Email: blackdrn@sohu.com
This product is free for use.
*/
//////////////////////////////////////////////////////////////////////////
#include <stdbool.h>
enum {ENCRYPT,DECRYPT};
//enum bool{false,true}; // if bool is not supported,use this or just replace with char
// and use 1 for true,0 for false;
//////////////////////////////////////////////////////////////////////////
// Type<70><65>ENCRYPT:<3A><><EFBFBD><EFBFBD>,DECRYPT:<3A><><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(Out)<29>ij<EFBFBD><C4B3><EFBFBD> >= ((datalen+7)/8)*8,<2C><><EFBFBD><EFBFBD>datalen<65><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// In <20><><EFBFBD><EFBFBD>= Out,<2C><>ʱ<EFBFBD><CAB1>/<2F><><EFBFBD>ܺ󽫸<DCBA><F3BDABB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBBBBA><EFBFBD><EFBFBD>(In)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><>keylen>8ʱϵͳ<CFB5>Զ<EFBFBD>ʹ<EFBFBD><CAB9>3<EFBFBD><33>DES<45><53>/<2F><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ʹ<EFBFBD>ñ<EFBFBD>׼DES<45><53>/<2F><><EFBFBD><EFBFBD>.<2E><><EFBFBD><EFBFBD>16<31>ֽں<D6BD>ֻȡǰ16<31>ֽ<EFBFBD>
bool Des_Go(char *Out,char *In,long datalen,const char *Key,int keylen,bool Type);
//////////////////////////////////////////////////////////////////////////