Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/home/groups/n/no/noxwizard/cvs/src/encryption.cpp File Reference

Encryption Stuff. More...

#include "nxwcommn.h"
#include "basics.h"

Defines

#define oldmalloc(A)   (new char[A])
#define oldfree(A)   { if (A!=NULL) delete A; }

Functions

void setkey (char *key)
void endes (char *block)
void dedes (char *block)
int desinit (int mode)
void desdone ()
void permute (char *inblock, char perm[16][16][8], char *outblock)
void round (int num, unsigned long *block)
long f (unsigned long r, unsigned char subkey[8])
void perminit (char perm[16][16][8], char p[64])
int spinit ()
void asciipack (char *packing)
void asciifacelift (char *packing)
char * pwdcypher (char *pwd, int salt)

Variables

char ip []
char fp []
char pc1 []
char totrot []
char pc2 []
char si [8][64]
char p32i []
long(* sp )[64]
char(* iperm )[16][8]
char(* fperm )[16][8]
unsigned char(* kn )[8]
int bytebit [] = { 0200,0100,040,020,010,04,02,01 }
int nibblebit [] = { 010,04,02,01 }
int desmode


Detailed Description

Encryption Stuff.


Define Documentation

#define oldfree      { if (A!=NULL) delete A; }
 

#define oldmalloc      (new char[A])
 


Function Documentation

void asciifacelift char *    packing [static]
 

void asciipack char *    packing [static]
 

void dedes char *    block
 

void desdone  
 

int desinit int    mode
 

void endes char *    block
 

long f unsigned long    r,
unsigned char    subkey[8]
[static]
 

void perminit char    perm[16][16][8],
char    p[64]
[static]
 

void permute char *    inblock,
char    perm[16][16][8],
char *    outblock
[static]
 

char* pwdcypher char *    pwd,
int    salt
 

void round int    num,
unsigned long *    block
[static]
 

void setkey char *    key
 

int spinit   [static]
 


Variable Documentation

int bytebit[] = { 0200,0100,040,020,010,04,02,01 } [static]
 

int desmode [static]
 

char fp[] [static]
 

Initial value:

 {
        40,  8, 48, 16, 56, 24, 64, 32,
        39,  7, 47, 15, 55, 23, 63, 31,
        38,  6, 46, 14, 54, 22, 62, 30,
        37,  5, 45, 13, 53, 21, 61, 29,
        36,  4, 44, 12, 52, 20, 60, 28,
        35,  3, 43, 11, 51, 19, 59, 27,
        34,  2, 42, 10, 50, 18, 58, 26,
        33,  1, 41,  9, 49, 17, 57, 25
}

char(* fperm)[16][8] [static]
 

char ip[] [static]
 

Initial value:

 {
        58, 50, 42, 34, 26, 18, 10,  2,
        60, 52, 44, 36, 28, 20, 12,  4,
        62, 54, 46, 38, 30, 22, 14,  6,
        64, 56, 48, 40, 32, 24, 16,  8,
        57, 49, 41, 33, 25, 17,  9,  1,
        59, 51, 43, 35, 27, 19, 11,  3,
        61, 53, 45, 37, 29, 21, 13,  5,
        63, 55, 47, 39, 31, 23, 15,  7
}

char(* iperm)[16][8] [static]
 

unsigned char(* kn)[8] [static]
 

int nibblebit[] = { 010,04,02,01 } [static]
 

char p32i[] [static]
 

Initial value:

 {      
        16,  7, 20, 21,
        29, 12, 28, 17,
         1, 15, 23, 26,
         5, 18, 31, 10,
         2,  8, 24, 14,
        32, 27,  3,  9,
        19, 13, 30,  6,
        22, 11,  4, 25
}

char pc1[] [static]
 

Initial value:

 {
        57, 49, 41, 33, 25, 17,  9,
         1, 58, 50, 42, 34, 26, 18,
        10,  2, 59, 51, 43, 35, 27,
        19, 11,  3, 60, 52, 44, 36,
        63, 55, 47, 39, 31, 23, 15,
         7, 62, 54, 46, 38, 30, 22,
        14,  6, 61, 53, 45, 37, 29,
        21, 13,  5, 28, 20, 12,  4
}

char pc2[] [static]
 

Initial value:

 {
        14, 17, 11, 24,  1,  5,
         3, 28, 15,  6, 21, 10,
        23, 19, 12,  4, 26,  8,
        16,  7, 27, 20, 13,  2,
        41, 52, 31, 37, 47, 55,
        30, 40, 51, 45, 33, 48,
        44, 49, 39, 56, 34, 53,
        46, 42, 50, 36, 29, 32
}

char si[8][64] [static]
 

long(* sp)[64] [static]
 

char totrot[] [static]
 

Initial value:

 {
        1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28
}
SourceForge.net Logo