Source code of Windows XP (NT5)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
/*
*
* Encryption Header. Function prototypes and defines for encrypted MSUAM authentication
*
*/
#ifndef DECR_KEY
#define DECR_KEY 0
#define ENCR_KEY 1
#define ENCR_STD 2
#define ENCR_SES 4
#endif
#define ENCR_RESULT_LENGTH 24
#define ENCRYPT 0
#define DECRYPT 1
#define LOCK_CRYPT() 0
#define UNLOCK_CRYPT() 0
#define StdEncrPwd "KGS!@#$%"
#define GETBIT(p, bit) (unsigned char) ((p[bit >> 3] >> (7 - (bit & 07))) & 01)
void UprCString(char* psz);
unsigned char *OneWayFunction(unsigned char *pucPwd, unsigned char *pucDest, short scb);
unsigned char *Encrypt(unsigned char *key, unsigned char *source, unsigned char *dest);
unsigned pascal CryptIOCTL2(unsigned, unsigned char *, unsigned char *, unsigned char *);
//short pascal DES_CBC( unsigned, unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned);
//void setkey(unsigned char *key);
Boolean SetupUAMEncrypt( void );
void CleanupUAMEncrypt( void );
/*-------------------------------------------------------------------*\
The DES key table (schedule). Generated from the key.
\*-------------------------------------------------------------------*/
typedef struct _KeyTbl
{
unsigned char KS[16][48];
} KeyTbl;
void InitKey( unsigned char *Key, KeyTbl * );
void des(unsigned char *inbuf, unsigned char *outbuf, KeyTbl *, int crypt_mode);
void key_table(unsigned char *key, KeyTbl *generatedKeyTable);
void des_cipher(unsigned char *block, KeyTbl *keySchedule, int crypt_mode);
|